Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-18-2009, 11:25 AM   PM User | #1
nico_icecold
New Coder

 
Join Date: Dec 2008
Posts: 23
Thanks: 6
Thanked 0 Times in 0 Posts
nico_icecold is an unknown quantity at this point
Angry Video scrubber not scrubbing!!

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));
}
nico_icecold is offline   Reply With Quote
Old 03-19-2009, 10:05 AM   PM User | #2
gnomeontherun
Senior Coder

 
gnomeontherun's Avatar
 
Join Date: Sep 2007
Location: Houston
Posts: 2,846
Thanks: 10
Thanked 238 Times in 229 Posts
gnomeontherun will become famous soon enoughgnomeontherun will become famous soon enough
Is this the code from gotoandlearn.com? Here is my guess at the problem. You have .x_ instead of ._x

Code:
ns.seek(Math.floor((loader.scrub._x/343)*duration))
Cheers
__________________
jeremy - gnomeontherun
Educated questions often get educated answers, and simple questions often get simple answers.
gnomeontherun is offline   Reply With Quote
Users who have thanked gnomeontherun for this post:
nico_icecold (03-19-2009)
Old 03-19-2009, 11:38 AM   PM User | #3
nico_icecold
New Coder

 
Join Date: Dec 2008
Posts: 23
Thanks: 6
Thanked 0 Times in 0 Posts
nico_icecold is an unknown quantity at this point
Yep, it is! Guy's a legend! Well spotted! Was drving me crazy!! Cheers for that, working fine now!!

Cheers

nico_icecold is offline   Reply With Quote
Reply

Bookmarks

Tags
acionscript, scrubber, video

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:33 AM.


Advertisement
Log in to turn off these ads.