flex 加载gif图片

来源:互联网 发布:spring 编程实例 编辑:程序博客网 时间:2024/06/10 14:34
 使用到的as3gif,请到Google去下载

view plaincopy to clipboardprint?
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" xmlns:file="file.*" xmlns:commont="commont.*">  
  3.     <mx:TitleWindow title="abc" id="ADwindow" width="400" height="283" >  
  4.         <mx:Image id="gifImg" width="221" height="92" creationComplete="init()"/>  
  5.         <mx:Image id="gifImg2" width="224" height="101" creationComplete="init2()"/>  
  6.           
  7.   
  8.     </mx:TitleWindow>  
  9.     <mx:Script>  
  10.         <!--[CDATA[  
  11.             import org.bytearray.gif.player.GIFPlayer;  
  12.               
  13.               
  14.             private var gifPlay:GIFPlayer=new GIFPlayer();  
  15.             private var gifPlay2:GIFPlayer=new GIFPlayer();  
  16.             private function init():void{  
  17.                 var req:URLRequest=new URLRequest("assets/logo.gif");  
  18.                 gifPlay.load(req);  
  19.                 gifImg.addChild(gifPlay);         
  20.             }   
  21.             private function init2():void{  
  22.                 var img:URLRequest=new URLRequest("assets/diego.gif");  
  23.                 gifPlay2.load(img);  
  24.                 gifImg2.addChild(gifPlay2);  
  25.             }  
  26.         ]]-->  
  27.     </mx:Script>  
  28. </mx:Application>  

原创粉丝点击