Use Behaviors
Flex的Behavior能够给应用程序添加动作和动画效果,如移动,模糊清晰,大小变化,透明度变化等。
Flex还支持多个行为按Parallel或Sequence的方式进行组合。
具体请看下面的示例:用到了文字的模糊变化,文字的移动,按钮的透明度变化。以下为MXML:

程序代码
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml" layout="absolute"
width="300" height="100" backgroundColor="0xFFFFFF">
<mx:Glow id="nGlow" color="0xFF6600" alphaFrom="1" alphaTo="0.3"
duration="2000"/>
<mx:Parallel id="blurMoveShow" target="{myLable}">
<mx:Blur id="nBlur" blurYFrom="10.0" blurYTo="0.0" blurXFrom="10.0"
blurXTo="0.0" duration="2000"/>
<mx:Move id="nMove" xFrom="20" xTo="150" duration="1500"/>
</mx:Parallel>
<mx:Button x="123" y="58" label="start" mouseUpEffect="{nGlow}"
click="blurMoveShow.play(); myLable.visible=true;"/>
<mx:Label x="10" y="30" text="Soking's desk" id="myLable" visible="false"/>
</mx:Application>