SoFunction
Updated on 2025-04-02

Tips for loading GIF images with flex

1. Download the GIFPlayer package

2. The source code is as follows:

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="/mxml/2009" 
 xmlns:s="library:///flex/spark" 
 xmlns:mx="library:///flex/mx" minWidth="955" minHeight="600">

<fx:Script>
<![CDATA[
import ; 


private var gifPlay:GIFPlayer=new GIFPlayer(); 
private var gifPlay2:GIFPlayer=new GIFPlayer(); 
private function init():void{ 
var req:URLRequest=new URLRequest("emergency/emergencyImg/"); 
(req); 
(gifPlay);     
}  

]]>
</fx:Script>
<fx:Declarations>
<!-- Will non-visible elements(For example, service、Value Object)Put it here -->
</fx:Declarations>

<mx:TitleWindow title="abc"  width="400" height="283" > 
<mx:Image  width="221" height="92" creationComplete="init()"/> 


</mx:TitleWindow> 
</s:Application>