...

View Full Version : Video scrubber not scrubbing!!



nico_icecold
03-18-2009, 12:25 PM
Hi guys

Okay, I have setup a video with loader and crubber. The problem I have is that the scrubber bar moves fine with the video,, it is clickable and dragable but when u drag it, it does not scrub through the video, and when you let go, the scrubber reverts back to the place in the timeline.

I think it might be an issue with my startDrag function, as it asks for a target, even thoigh i have this. as a prefix:

this.startDrag(false,0,this._y,343,this._y);

Anyone shed some light??

Thanks in advance

Here is the code im using for the scrubber:

function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadbar._width = amountLoaded * 343;
loader.scrub._x = ns.time / duration * 343;
}

var scrubInterval;

loader.scrub.onPress = function(){
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit,10);
this.startDrag(false,0,this._y,343,this._y);
}



loader.scrub.onRelease = loader.scrub.onReleaseOutside = function(){
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus,100);
this.stopDrag();
}

function scrubit(){
ns.seek(Math.floor((loader.scrub.x_/343)*duration));
}

gnomeontherun
03-19-2009, 11:05 AM
Is this the code from gotoandlearn.com? Here is my guess at the problem. You have .x_ instead of ._x


ns.seek(Math.floor((loader.scrub._x/343)*duration))

Cheers

nico_icecold
03-19-2009, 12:38 PM
Yep, it is! Guy's a legend! Well spotted! Was drving me crazy!! Cheers for that, working fine now!!

Cheers

:thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum