flex中的GIF动画

Muh*_*mar 2 apache-flex actionscript actionscript-3 flash-builder

我想在我的flex应用程序中添加一个gif图像.然而,它没有显示动画.任何人都知道如何使gif图像在flex中工作

import mx.managers.PopUpManager;

            private function onCreationCompleted():void
            {
                mx.managers.PopUpManager.centerPopUp(this);
            }
        ]]>
    </fx:Script>
    <s:Image x="127" y="137" source="@Embed('assets/loading.gif')" width="87" height="85"/> 
    <s:Label x="88" y="73" text="Loading... Please wait" width="164" height="56" verticalAlign="middle" textAlign="center"/>
Run Code Online (Sandbox Code Playgroud)

提前问候

Ran*_*ray 7

从外观上看,Flex不支持动画GIF.使用swf会容易得多.

这个链接提供了一些非常好的加载动画.用一个SWFLoader.

但是,如果你想在Flex中使用动画GIF,请阅读此博文.

http://iamjosh.wordpress.com/2009/02/03/animated-gifs-in-flex/

您必须创建该博客文章中显示的类,并将as3gif作为包添加.

你可以从这里下载as3gif