加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

flex用弹出窗体展示gif

发布时间:2020-12-15 01:29:36 所属栏目:百科 来源:网络整理
导读:GIFPlayer用于在flex中展示GIF图片。 ? 类库网站 http://www.bytearray.org/?p=95 代码获取网站 http://code.google.com/p/as3gif/ ? 环境:flex4+GIFPlayer0.6 ? 1.下载GIFPlayer源码,到项目中 2.新建LoadingView.mxml ----------------------------------

GIFPlayer用于在flex中展示GIF图片。

?

类库网站

http://www.bytearray.org/?p=95

代码获取网站

http://code.google.com/p/as3gif/

?

环境:flex4+GIFPlayer0.6

?

1.下载GIFPlayer源码,到项目中

2.新建LoadingView.mxml

-------------------------------------------

<?xml version="1.0" encoding="utf-8"?>
<s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
??? ??? ??? ?? xmlns:s="library://ns.adobe.com/flex/spark"
??? ??? ??? ?? xmlns:mx="library://ns.adobe.com/flex/mx"
??? ??? ??? ?? width="180" height="88"?
??? ??? ??? ?? creationComplete="init()"
??? ??? ??? ?? title="正在加载,请稍等。。。" enabled="true" >
??? <s:layout>
??? ??? <s:BasicLayout/>
??? </s:layout>
??? <fx:Declarations>
??? ??? <!-- 将非可视元素(例如服务、值对象)放在此处 -->
??? </fx:Declarations>
??? <fx:Script>
??? ??? <![CDATA[
??? ??? ??? import org.bytearray.gif.player.GIFPlayer;
??? ??? ???
??? ??? ???
??? ??? ??? public var myGIFPlayer:GIFPlayer = new GIFPlayer(true);
??? ??? ???
??? ??? ??? public function init():void {
??? ??? ??? ??? //隐藏关闭按钮
??? ??? ??? ??? this.closeButton.visible=false;
??? ??? ??? ??? //gif图片路径
??? ??? ??? ??? var request:URLRequest = new URLRequest("styles/loading/loadingimage4.gif");
??? ??? ??? ??? //GIFPlayer加载图片
??? ??? ??? ??? myGIFPlayer.load(request);
??? ??? ??? ??? myGIFPlayer.visible = true;
??? ??? ??? ??? //图片绑定GIFPlayer
??? ??? ??? ??? img.addChild(myGIFPlayer);
??? ??? ??? }
??? ??? ???
??? ??? ???
??? ??? ]]>
??? </fx:Script>
??? <mx:Image id="img" width="50" height="50" x="66" y="3">
??? ???
??? </mx:Image>
</s:TitleWindow>

?

3.调用

private var window:LoadingView;

window = new LoadingView();
PopUpManager.addPopUp(window,this,true);
PopUpManager.centerPopUp(window);

?

4.移除

PopUpManager.removePopUp(window);

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读