1.制作文字淡入淡出效果
<fx:Script>
<![CDATA[
protected function button1_clickHandler(event:MouseEvent):void
{
label1.visible = !label1.visible;
}
]]>
</fx:Script>
<fx:Declarations>
<s:Fade />
<s:Fade />
</fx:Declarations>
<mx:Label text="hello world!" />
<s:Button x="227" y="38" label="按钮" click="button1_clickHandler(event)"/>
2.制作文字滚动效果
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="application1_creationCompleteHandler(event)">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
protected function application1_creationCompleteHandler(event:FlexEvent):void
{
moveit.yFrom = label1.y;
moveit.yTo = label1.y + 200;
moveit.repeatCount = 1;
moveit.repeatDelay = 0;
moveit.duration = 5000;
moveit.play();
}
protected function label1_mouseOverHandler(event:MouseEvent):void
{
moveit.pause();
}
protected function label1_mouseOutHandler(event:MouseEvent):void
{
moveit.resume();
}
]]>
</fx:Script>
<fx:Declarations>
<s:Move />
</fx:Declarations>
<s:Label />
</s:Application>
3.制作文字阴影效果
<fx:Declarations>
<s:DropShadowFilter />
</fx:Declarations>
<s:Label x="354" y="87" text="这是一个测试" fontSize="32" filters="{dropShadow}" />