Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Dec 2008
    Posts
    23
    Thanks
    6
    Thanked 0 Times in 0 Posts

    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));
    }

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    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.

  • Users who have thanked gnomeontherun for this post:

    nico_icecold (03-19-2009)

  • #3
    New Coder
    Join Date
    Dec 2008
    Posts
    23
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Yep, it is! Guy's a legend! Well spotted! Was drving me crazy!! Cheers for that, working fine now!!

    Cheers



  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •