`

flex显示gir动画

    博客分类:
  • flex
 
阅读更多

在flex中是不支持gir动画的,我们可以利用第三方组件来完成也可以用flash cs 将gif转换成swf 然后加载也可以,推荐直接用第三方组件,GIFPlayer 下载地址请看:http://code.google.com/p/as3gif/ , 目前版本0.6 或http://code.google.com/p/as3gif/downloads/list

 

下载后是没有swc文件的,我们可以直接新建一个库项目然后弄成swc文件,在工程之直接引用,也可以直接将源代码拷到自己的工程中去,修改包路径

 

加载代码如下:

    <fx:Script>
        <![CDATA[
            import com.huawei.gts.nis.cloudstudio.iaas.util.gif.player.GIFPlayer;
            import mx.events.FlexEvent;
            private var myGIFPlayer:GIFPlayer=new GIFPlayer(true);

            protected function bordercontainer1_creationCompleteHandler(event:FlexEvent):void
            {
                var request:URLRequest=new URLRequest("com/huawei/gts/nis/cloudstudio/iaas/image/toolicon/blue-loading.gif");
                myGIFPlayer.load(request);
                img.addChild(myGIFPlayer);
            }
        ]]>
    </fx:Script>
    <fx:Declarations>
        <!-- 将非可视元素(例如服务、值对象)放在此处 -->
    </fx:Declarations>
    <!--source="com/huawei/gts/nis/cloudstudio/iaas/image/toolicon/blue-loading.gif"-->
    <mx:Image id="img"
              width="32"
              height="32"/>
    <s:Label text="processing......" fontWeight="bold"/>

 

2. 生成遮罩层

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics