Transitions work just fine in flex4, but you need to declare them in a
<transitions> block (just like in flex3), not in the Declarations block:
<s:transitions>
<s:Transition fromState=”primary” toState=”secondary”>
<s:Sequence targets=”{[panel1]}”>
// etc.
Note that Blur is not an effect in Flex4, but it should work fine as long as
you target a component (flex3 effects don’t work on graphic elements, which is
one of the reasons for the new flex4 effects). To get a flex4 effect that runs
a blur, use AnimateFilter with a BlurFilter specified as the filter you are
animating.
Chet.
From: [email protected] [mailto:[email protected]] On Behalf
Of j2me_soul
Sent: Tuesday, June 23, 2009 11:30 PM
To: flexcoders
Subject: [flexcoders] About effect in Flex4
When I clicked the button to change state,but the transition effect doesn't
work.
I wonder if the transition is still available in Flex4?
<s:states>
<s:State name="premiere" />
<s:State name="secondary" />
</s:states>
<fx:Declarations>
<mx:Transition fromState="premiere" toState="secondary">
<mx:Sequence id="t1" targets="{[panel1]}">
<mx:Blur duration="100" blurXFrom="0.0" blurXTo="10.0"
blurYFrom="0.0" blurYTo="10.0"/>
<mx:Parallel>
<mx:Move duration="400" xTo="0" yTo="428"/>
<mx:Resize duration="400" widthTo="106" heightTo="52"/>
</mx:Parallel>
<mx:Blur duration="100" blurXFrom="10.0" blurXTo="0.0"
blurYFrom="10.0" blurYTo="0.0"/>
</mx:Sequence>
</mx:Transition>
</fx:Declarations>
<s:Panel id="panel1" title="Panel Horizontal"
x.premiere="0" y.premiere="313.1" width.premiere="1021"
height.premiere="167" >
<s:HGroup>
<s:Button label="Up" label.secondary="Up"
click.premiere="currentState='secondary'"
click.secondary="currentState='premiere'"
label.premiere="Down"/>
</s:HGroup>
</s:Panel>
________________________________
200万种商品,最低价格,疯狂诱惑你<http://count.mail.163.com/redirect/footer.htm?f=http://gouwu.youdao.com>