首页  >  文章  >  php教程  >  flex小技巧之加载GIF图片

flex小技巧之加载GIF图片

高洛峰
高洛峰原创
2016-12-27 17:10:491174浏览

一、下载GIFPlayer包

二、源码如下:

<?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">
 
<fx:Script>
<![CDATA[
import org.bytearray.gif.player.GIFPlayer; 
 
 
private var gifPlay:GIFPlayer=new GIFPlayer(); 
private var gifPlay2:GIFPlayer=new GIFPlayer(); 
private function init():void{ 
var req:URLRequest=new URLRequest("emergency/emergencyImg/mark.gif"); 
gifPlay.load(req); 
gifImg.addChild(gifPlay);     
}  
 
]]>
</fx:Script>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations>
 
<mx:TitleWindow title="abc" id="ADwindow" width="400" height="283" > 
<mx:Image id="gifImg" width="221" height="92" creationComplete="init()"/> 
 
 
</mx:TitleWindow> 
</s:Application>

更多flex小技巧之加载GIF图片相关文章请关注PHP中文网!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn