[flexcoders] Re: addChild creationCompleteEffect

2007-10-25 Thread johantrax
What I have done is setting a breakpoint on the line of the
move-effect-tag in which both width and height are 0.

So Now I have added some 'debugging-alerts'
 (1) one in the creationcomplete-event of the popupwindowcomponent,
before the inner form is added
 (2) one in the creationcomplete-event of the injected form, before
its fields/innercomponents are added
 (3) second-one in the creationcomplete-event of the injected form
after it's children are added with addChild()
 (4) second-one in the creationcomplete-event of the popupwindow after
the inner form has been added with the addChild()-method.

These do not appear in this order!
The order of appearance is
 (1) popupwindow.width = 52 | height = 48
 (4) popupwindow.width = 52 | height = 48
 (2) injectedForm.width = 20 | height = 20
 (3) injectedForm.width = 20 | height = 20

Not quite what I expected..
--Johan

--- In flexcoders@yahoogroups.com, Tom Chiverton [EMAIL PROTECTED]
wrote:
 
 Have you stopped it in the debugger to check the values before/after
the move 
 effect ?
 
 -- 
 Tom Chiverton. Are you a great Flex programmer, who knows Cairngorm,
and has 
 done some ColdFusion work ? Would you like to work for a top 30 law
firm in 
 Manchester, UK ? Are not an agency ? If yes, send email !
 
 
 
 This email is sent for and on behalf of Halliwells LLP.
 
 Halliwells LLP is a limited liability partnership registered in
England and Wales under registered number OC307980 whose registered
office address is at St James's Court Brown Street Manchester M2 2JF.
 A list of members is available for inspection at the registered
office.  Any reference to a partner in relation to Halliwells LLP
means a member of Halliwells LLP.  Regulated by The Solicitors
Regulation Authority.
 
 CONFIDENTIALITY
 
 This email is intended only for the use of the addressee named above
and may be confidential or legally privileged.  If you are not the
addressee you must not read it and must not use any information
contained in nor copy it nor inform any person other than Halliwells
LLP or the addressee of its existence or contents.  If you have
received this email in error please delete it and notify Halliwells
LLP IT Department on 0870 365 8008.
 
 For more information about Halliwells LLP visit www.halliwells.com.





[flexcoders] Re: addChild creationCompleteEffect

2007-10-18 Thread johantrax
Nobody with any tips? :(

--Johan

--- In flexcoders@yahoogroups.com, johantrax [EMAIL PROTECTED]
wrote:

 Hi all,
 
 I create a TitleWindow with the PopupManager. The titlewindow should
 dynamically contain a canvas.
 So how did I do that. I gave the titlewindow a property called
 'contentForm' which contains a canvas. Then in the
 creationComplete-event of the titlewindow, addChild(contentForm) is
 called for adding the canvas to the titlewindow.
 So far, so good...
 
 Next I wanted to create some popup/popout effect on the titlewindow.
 So I set creationCompleteEffect to 'popup', a mx:Parallel of
 zoom/move/fade. I also set the removedEffect to 'popout', a mx:Sequence.
 
 What's the problem? The 'popup'-effect should move the titlewindow
 from the top to the center of the application. I figured this move-tag
 would give me what needed:
   mx:Move
   yFrom={-this.height} yTo={(Application.application.height -
 this.height) / 2}
   xFrom={Application.application.width / 2}
 xTo={(Application.application.width - this.width) / 2}
   /
 However, this isn't working as expected.
 The only logical explanation I can come up with is the following:
 creationComplete and creationCompleteEffect both get executed when the
 creationcomplete-Event is fired. Since the childComponent is only
 added during the handling of that event, the effect playing is not yet
 aware of the change in size.
 
 This lead me into the FlexDocs, where I learned that adding children
 should be part of the initialisationEvent.
 So I assigned my init()method to the initialize-listener instead of
 creationComplete.
 However, this is giving me the following errors:
 TypeError: Error #1009: Cannot access a property or method of a null
 object reference.
   at mx.containers::Panel/::showTitleBar()
   at mx.containers::Panel/mx.containers:Panel::layoutChrome()
   at mx.core::Container/mx.core:Container::updateDisplayList()
 ...
 TypeError: Error #1009: Cannot access a property or method of a null
 object reference.
   at components::PopupFormWindow/::init()
   at components::PopupFormWindow/___TitleWindow1_initialize()
   at

flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
 ...
 
 My init-method is as follows:
 private function init():void {
   //create inner form
   contentForm.currentState = this.currentState;
   (contentForm as customerPopupForm).ac = this.ac;
   this.addChild(contentForm);
 }
 
 Any help, push in the right direction is really appreciated. I will
 provide the full errormsgs/more code if needed, but I consider this to
 be a long post already ;)
 --Johan





RE: [flexcoders] Re: addChild creationCompleteEffect

2007-10-18 Thread Joan Lafferty
Maybe try your effect on the showEffect rather than the
creationCompleteEffect? I haven't tried this to see if it works... just
a suggestion.

 

Joan

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of johantrax
Sent: Thursday, October 18, 2007 8:16 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: addChild  creationCompleteEffect

 

Nobody with any tips? :(

--Johan

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, johantrax [EMAIL PROTECTED]
wrote:

 Hi all,
 
 I create a TitleWindow with the PopupManager. The titlewindow should
 dynamically contain a canvas.
 So how did I do that. I gave the titlewindow a property called
 'contentForm' which contains a canvas. Then in the
 creationComplete-event of the titlewindow, addChild(contentForm) is
 called for adding the canvas to the titlewindow.
 So far, so good...
 
 Next I wanted to create some popup/popout effect on the titlewindow.
 So I set creationCompleteEffect to 'popup', a mx:Parallel of
 zoom/move/fade. I also set the removedEffect to 'popout', a
mx:Sequence.
 
 What's the problem? The 'popup'-effect should move the titlewindow
 from the top to the center of the application. I figured this move-tag
 would give me what needed:
 mx:Move
 yFrom={-this.height} yTo={(Application.application.height -
 this.height) / 2}
 xFrom={Application.application.width / 2}
 xTo={(Application.application.width - this.width) / 2}
 /
 However, this isn't working as expected.
 The only logical explanation I can come up with is the following:
 creationComplete and creationCompleteEffect both get executed when the
 creationcomplete-Event is fired. Since the childComponent is only
 added during the handling of that event, the effect playing is not yet
 aware of the change in size.
 
 This lead me into the FlexDocs, where I learned that adding children
 should be part of the initialisationEvent.
 So I assigned my init()method to the initialize-listener instead of
 creationComplete.
 However, this is giving me the following errors:
 TypeError: Error #1009: Cannot access a property or method of a null
 object reference.
 at mx.containers::Panel/::showTitleBar()
 at mx.containers::Panel/mx.containers:Panel::layoutChrome()
 at mx.core::Container/mx.core:Container::updateDisplayList()
 ...
 TypeError: Error #1009: Cannot access a property or method of a null
 object reference.
 at components::PopupFormWindow/::init()
 at components::PopupFormWindow/___TitleWindow1_initialize()
 at

flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEven
tFunction()
 ...
 
 My init-method is as follows:
 private function init():void {
 //create inner form
 contentForm.currentState = this.currentState;
 (contentForm as customerPopupForm).ac = this.ac;
 this.addChild(contentForm);
 }
 
 Any help, push in the right direction is really appreciated. I will
 provide the full errormsgs/more code if needed, but I consider this to
 be a long post already ;)
 --Johan


 



RE: [flexcoders] Re: addChild creationCompleteEffect

2007-10-18 Thread Joan Lafferty
One more suggestion to try. You can listen for the childAdd event on the
TitleWindow. Then, in the event handler, play the effect on the Canvas.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Joan Lafferty
Sent: Thursday, October 18, 2007 10:06 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: addChild  creationCompleteEffect

 

Maybe try your effect on the showEffect rather than the
creationCompleteEffect? I haven't tried this to see if it works... just
a suggestion.

 

Joan

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of johantrax
Sent: Thursday, October 18, 2007 8:16 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: addChild  creationCompleteEffect

 

Nobody with any tips? :(

--Johan

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, johantrax [EMAIL PROTECTED]
wrote:

 Hi all,
 
 I create a TitleWindow with the PopupManager. The titlewindow should
 dynamically contain a canvas.
 So how did I do that. I gave the titlewindow a property called
 'contentForm' which contains a canvas. Then in the
 creationComplete-event of the titlewindow, addChild(contentForm) is
 called for adding the canvas to the titlewindow.
 So far, so good...
 
 Next I wanted to create some popup/popout effect on the titlewindow.
 So I set creationCompleteEffect to 'popup', a mx:Parallel of
 zoom/move/fade. I also set the removedEffect to 'popout', a
mx:Sequence.
 
 What's the problem? The 'popup'-effect should move the titlewindow
 from the top to the center of the application. I figured this move-tag
 would give me what needed:
 mx:Move
 yFrom={-this.height} yTo={(Application.application.height -
 this.height) / 2}
 xFrom={Application.application.width / 2}
 xTo={(Application.application.width - this.width) / 2}
 /
 However, this isn't working as expected.
 The only logical explanation I can come up with is the following:
 creationComplete and creationCompleteEffect both get executed when the
 creationcomplete-Event is fired. Since the childComponent is only
 added during the handling of that event, the effect playing is not yet
 aware of the change in size.
 
 This lead me into the FlexDocs, where I learned that adding children
 should be part of the initialisationEvent.
 So I assigned my init()method to the initialize-listener instead of
 creationComplete.
 However, this is giving me the following errors:
 TypeError: Error #1009: Cannot access a property or method of a null
 object reference.
 at mx.containers::Panel/::showTitleBar()
 at mx.containers::Panel/mx.containers:Panel::layoutChrome()
 at mx.core::Container/mx.core:Container::updateDisplayList()
 ...
 TypeError: Error #1009: Cannot access a property or method of a null
 object reference.
 at components::PopupFormWindow/::init()
 at components::PopupFormWindow/___TitleWindow1_initialize()
 at

flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEven
tFunction()
 ...
 
 My init-method is as follows:
 private function init():void {
 //create inner form
 contentForm.currentState = this.currentState;
 (contentForm as customerPopupForm).ac = this.ac;
 this.addChild(contentForm);
 }
 
 Any help, push in the right direction is really appreciated. I will
 provide the full errormsgs/more code if needed, but I consider this to
 be a long post already ;)
 --Johan


 



[flexcoders] Re: addChild creationCompleteEffect

2007-10-18 Thread johantrax
Thanks for the input, however with little success.
Adding the effect to showEffect gives nothing. If I recall correctly
showeffect is triggered by clicking the object when it's inside a
viewstack.

However listening to the childAdd brought me to the following idea.
At the end of me creationCompleteHandler I have put the following:
callLater(function():void{popup.play([this])});

This gives me the same error as listening to the addChildEvent, being
the following:

TypeError: Error #1006: dispatchEvent is not a function.
at mx.effects::EffectInstance/play()
at mx.effects.effectClasses::MoveInstance/play()
at mx.effects::EffectInstance/startEffect()
at mx.effects.effectClasses::ParallelInstance/play()
at mx.effects::EffectInstance/startEffect()
at mx.effects::Effect/play()
at MethodInfo-3081()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/::callLaterDispatcher2()
at mx.core::UIComponent/::callLaterDispatcher()

--Johan

--- In flexcoders@yahoogroups.com, Joan Lafferty [EMAIL PROTECTED] wrote:

 One more suggestion to try. You can listen for the childAdd event on the
 TitleWindow. Then, in the event handler, play the effect on the Canvas.
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Joan Lafferty
 Sent: Thursday, October 18, 2007 10:06 AM
 To: flexcoders@yahoogroups.com
 Subject: RE: [flexcoders] Re: addChild  creationCompleteEffect
 
  
 
 Maybe try your effect on the showEffect rather than the
 creationCompleteEffect? I haven't tried this to see if it works... just
 a suggestion.
 
  
 
 Joan