nico_icecold
03-18-2009, 11:25 AM
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));
}
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));
}