actionscript 3 - Progress Bar, but NOT a Preloader or FLV Seekbar -
actionscript 3 - Progress Bar, but NOT a Preloader or FLV Seekbar -
i'm trying create progress bar monitor timeline progression of loaded film clip. of tutorials out there based on preloaders. while concept similar, i'm struggling.
users load various film clips clicking on left navigation menu. i'd progress bar show users in film clip's timeline. i'd progress bar start on when new film clip loaded.
my progress bar 508 pixels wide.
any ideas?
it's simple really. multiply total width percentage film clip, this:
var clip:movieclip; //set film clip has been loaded clip.addeventlistener( event.enter_frame, this.enterframehandler ); var progressbar:shape = new shape(); var totalwidth:number = 508; function enterframehandler( e:event ):void { this.progressbar.graphics.clear(); this.progressbar.graphics.beginfill( 0x000000 ); this.progressbar.graphics.drawrect( 0, 0, ( this.clip.currentframe / this.clip.totalframes ) * this.totalwidth, 10 ); this.progressbar.graphics.endfill(); }
if referring actual video clips (using film clip in case can confusing because there movieclip class), tad bit more hard because netstream
class has no progress events or total time property. have hear metadata received has totaltime in it, save global var. can utilize same method shown above (using enter_frame on container object, rather film object) , utilize ( netstream.time / totaltime ) * totalwidth
instead.
actionscript-3 progress-bar seekbar
Comments
Post a Comment