flex小技巧之加载GIF图片
一、下载GIFPlayer包
二、源码如下:
<?xmlversion="1.0"encoding="utf-8"?> <s:Applicationxmlns: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"> <fx:Script> <![CDATA[ importorg.bytearray.gif.player.GIFPlayer; privatevargifPlay:GIFPlayer=newGIFPlayer(); privatevargifPlay2:GIFPlayer=newGIFPlayer(); privatefunctioninit():void{ varreq:URLRequest=newURLRequest("emergency/emergencyImg/mark.gif"); gifPlay.load(req); gifImg.addChild(gifPlay); } ]]> </fx:Script> <fx:Declarations> <!--将非可视元素(例如服务、值对象)放在此处--> </fx:Declarations> <mx:TitleWindowtitle="abc"id="ADwindow"width="400"height="283"> <mx:Imageid="gifImg"width="221"height="92"creationComplete="init()"/> </mx:TitleWindow> </s:Application>