flex 4里一个传统的闪烁效果

<?xml version="1.0" encoding="utf-8"?> 

<!-- http://blog.flexexamples.com/2010/08/13/creating-blinking-text-on-a-spark-richtext-control-in-flex-4/ --> 

<s:Application name="Spark_RichText_blink_test" 

  xmlns:fx="http://ns.adobe.com/mxml/2009" 

  xmlns:s="library://ns.adobe.com/flex/spark" 

  xmlns:mx="library://ns.adobe.com/flex/mx"> 

<s:layout> 

<s:HorizontalLayout horizontalAlign="center" verticalAlign="middle" /> 

</s:layout> 

<fx:Declarations> 

<s:Animate id="fader" 

  duration="500" 

  repeatBehavior="reverse" 

  repeatCount="0" 

  target="{lbl}"> 

<s:SimpleMotionPath property="alpha" 

valueFrom="1.0" valueTo="0.0" /> 

</s:Animate> 

</fx:Declarations> 

<s:Label id="lbl" 

text="BLINKING TEXT, I HATE YOU!" 

color="red" 

fontSize="32" 

creationComplete="fader.play();" /> 

</s:Application>

posted on 2012-02-25 08:25  唐朝  阅读(1871)  评论(0编辑  收藏  举报