I’m tweaking the video code found here http://www.thetechlabs.com/tutorials/audionvideo/how-to-build-a-as3-videoplayer/
His progress bar starts at the edge of the stage. My progress bar starts at x=40 into the stage. My problem is that even though all my mcs related to the progress bar are positioned properly the scrubber mc hops to the edge of the screen when the video starts. It also acts as if the progress bar you scrub though is at the edge of the screen too. I can’t figure out why it’s doing this. There’s nothing in the code to tell it to do as such. :no_love::no_love:
function progressScrubberClicked(e:MouseEvent):void {
// set progress scrub flag to true
bolProgressScrub = true;
// start drag
mcVideoControls.mcProgressScrubber.startDrag(true, new Rectangle(40, 13, 416, 0));
}
function mouseReleased(e:MouseEvent):void {
bolProgressScrub = false;
mcVideoControls.mcProgressScrubber.stopDrag();
mcVideoControls.mcProgressFill.mcFillGrey.width = mcVideoControls.mcProgressScrubber.x - 40;
}
function updateDisplay(e:TimerEvent):void {
if(bolProgressScrub)
nsStream.seek(Math.round(mcVideoControls.mcProgressScrubber.x * objInfo.duration / 416));
else
mcVideoControls.mcProgressScrubber.x = nsStream.time * 416 / objInfo.duration;
mcVideoControls.lblTimeDuration.htmlText = "" + formatTime(nsStream.time) + " / " + formatTime(objInfo.duration);
mcVideoControls.mcProgressFill.mcFillGrey.width = mcVideoControls.mcProgressScrubber.x - 40;
mcVideoControls.mcProgressFill.mcFillWhite.width = nsStream.bytesLoaded * 416 / nsStream.bytesTotal;
}