开发者

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

This question already has an answer here: Closed 11 years ago.
开发者_如何转开发

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?


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


Change the component line to

<ns:Component showEffect="{move1}" hideEffect="{move2}" />

and in the Declarations, add this:

<s:Move id="move1" xFrom="-400" xTo="50" />
<s:Move id="move2" xTo="-400" xFrom="50" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜