flex小技巧之加载GIF图片

编程学习 2021-07-05 11:32www.dzhlxh.cn编程入门
这篇文章主要是flex使用GIFPlayer加载GIF图片的代码示例,需要的朋友可以参考下

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

Copyright © 2016-2025 www.dzhlxh.cn 金源码 版权所有 Power by

网站模板下载|网络推广|微博营销|seo优化|视频营销|网络营销|微信营销|网站建设|织梦模板|小程序模板