flash自身loading
上海/动画师/11年前/745浏览
版权
flash自身loading
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
相关收藏夹
Log in
推荐Log in and synchronize recommended records
3Log in and add to My Favorites
评论Log in and comment your thoughts
分享Share














































































