Apache – Flex transitions target all elements

apache-flex

I want to fade all the elements of the next state when transitioning from any state.
I tried different things but I can't get it to work. And I don't want to manually add transitions for every state.

Something like:

<s:Transition fromState="*" toState="*">
        <s:Fade target="*" duration="500" />
    </s:Transition>

Best Answer

Hey, mihaimetal. I just found your post after struggling with this same thing myself. It turns out that the best way to do this is not to use the target property, but the targets one instead. This way, you can pass a whole Array of things that may be changed. I emphasize 'may', because only the items you give in the Array you pass to targets that are actually changed between states will will be affected.

You can change your sample code like so:

<s:Transition fromState="*" toState="*">
    <s:Fade targets="{[hboxID_1, hboxID_2, hboxID_3]}" duration="500" />
</s:Transition>

Hope this helps!

Related Topic