Search code examples
apache-flexflex4effectsflex-spark

How can I add effects to the show/hide of a spark control?


Possible Duplicate:
Flex 4 Group showEffect/hideEffect

I have an existing flex application that uses databinding to show/hide certain elements. It looks a little like this:

<namespace:CustomComponent visible="{modelObject.showCustomComponent}" />

To spruce it up a little bit, I went in and did this:

<s:Move id="ccRollIn" target="{cc}" xFrom="-400" xTo="50" />
...
<namespace:CustomComponent id="cc" visible="{modelObject.showCustomComponent}" show="ccRollIn.play()" hide="ccRollIn.play(null, true)" />

The problem with this is that while the show event plays perfectly, the item disappears from view before the hide effect has a chance to play. Is there a simple way to handle adding animations to this workflow?


Solution

  • Use showEffect and hideEffect as in documentation or in this sample.