views:

27

answers:

1

Hi,

I have run into a problem where I am removing a component and adding another one. I have set addedEffect and removedEffect for corresponding component.

But the addedEffect starts before the removedEffect completes.

How can i make them in order ??

I am doing this in actionscript.So, in this case i'm not using state and transition.

Any help would be really good.

Thanks.

A: 

You can move the code to add the next component into the Effect completion handler for removing the first component. This will guarantee that nothing will get added until the previous component removing Effect has finished.

[Edit]

Based on your question, I will assume you already know how to assign an Effect to the desired component event (when removing in this case).

Make sure you declare the effect with an effectEnd handler, for example

<s:Fade id="fader" effectEnd="effectEndHandler(event)"/>

Place the code to add the next component, in the function effectEndHandler.

Jason W
@Jason : a small code snippet would be really helpful. Thanks
Ravz
You mean move the code to add the next component, not the next effect, right? In other words, remove the component, wait for the remove effect to end, and then add the new component which will trigger the add effect.
bug-a-lot
@bug-a-lot, that's correct, sorry for the mix up
Jason W