flash自身loading

上海/动画师/11年前/745浏览
flash自身loading
vini123

flash自身loading,很早就会做了。只是很久不做了。今天给公司的推广页面左一个loading的时候,发现侦听的 ProgressEvent.PROGRESS事件侦听不到。也就是侦听的进度只有100%。那该怎么解决这个问题呢.




flash自身loading,很早就会做了。只是很久不做了。今天给公司的推广页面左一个loading的时候,发现侦听的 ProgressEvent.PROGRESS事件侦听不到。也就是侦听的进度只有100%。那该怎么解决这个问题呢,请看截图:




就是将链接这里,将”在第1帧中导出”前边的勾勾去掉就可以了。





package com.vini123{    import flash.display.MovieClip;    import flash.display.StageScaleMode;    import flash.display.StageAlign;    import flash.events.ProgressEvent;    import flash.events.Event;    import com.vini123.utils.share.ShareButton;    publicclass Main extendsMovieClip    {        privatevar shareButton:ShareButton;        publicfunction Main():void        {            stage.scaleMode = StageScaleMode.NO_SCALE;            stage.align = StageAlign.TOP_LEFT;            addFrames cript(0 , frame1 , 1 , frame2);        }        privatefunction frame1():void        {            stop();            this.loaderInfo.addEventListener(ProgressEvent.PROGRESS,progressHandler);            this.loaderInfo.addEventListener(Event.COMPLETE , completeHandler);        }        privatefunction progressHandler(e:ProgressEvent):void        {            var percent:Number = Math.round(1000 * (e.bytesLoaded / e.bytesTotal))/10;
            loading.percentTxt.text = percent;        }        privatefunction completeHandler(e:Event):void        {            loading.bracelet.gotoAndStop(1);            loading.visible = false;            e.target.removeEventListener(ProgressEvent.PROGRESS,progressHandler);            e.target.removeEventListener(Event.COMPLETE , completeHandler);            nextFrame();        }        privatefunction frame2():void        {            shareButton = new ShareButton();            shareButton.x = 10;            shareButton.y = stage.stageHeight - shareButton.height -5;            addChild(shareButton);        }    }}

Bg.as

package com.vini123.view{    import flash.display.MovieClip;    import flash.events.Event;    publicclass Bg extendsMovieClip    {        publicfunction Bg():void        {            addEventListener(Event.ENTER_FRAME , enterHandler);        }        privatefunction enterHandler(e:Event):void        {            var frame:int = Math.round(100 * Math.random());            this.gotoAndStop(frame);        }    }}







0
Report
|
3
Share
相关推荐
评论
in to comment
Add emoji
喜欢TA的作品吗?喜欢就快来夸夸TA吧!
推荐素材
You may like
一大波可爱小动物
Homepage recommendation
《马到成功》2026马年IP
Homepage recommendation
相关收藏夹
茶酒包装
茶酒包装
茶酒包装
茶酒包装
精选收藏夹
作品收藏夹
疯狂动物城同人作品
疯狂动物城同人作品
疯狂动物城同人作品
疯狂动物城同人作品
精选收藏夹
作品收藏夹
IP形象及IP内容
IP形象及IP内容
IP形象及IP内容
IP形象及IP内容
精选收藏夹
作品收藏夹
作品集
作品集
作品集
作品集
精选收藏夹
作品收藏夹
作品集
作品集
作品集
作品集
精选收藏夹
作品收藏夹
小家电
小家电
小家电
小家电
精选收藏夹
作品收藏夹
大家都在看
Log in