actionscript-3apache-flexactionscriptflash-builder

Animated GIF in flex


I am trying to add a GIF image in my flex application. However it is not showing animations. Anyone have idea how to make a GIF image work in 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"/>

Solution

  • From the looks of it Flex does not provide support for animated gifs. It would be much easier to use a swf.

    There are some very nice loading animations provided in this link. Use a SWFLoader.

    However if you do want to use animated gifs in Flex read this blogpost.

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

    You have to create the class shown in that blog post and add as3gif as a package.

    you can download as3gif from here