欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

flex小技巧之加载GIF图片

程序员文章站 2022-06-28 14:07:36
一、下载gifplayer包 二、源码如下: &...

一、下载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 gifplayer