SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Creating a slider bar

    Hi guys



    Working on a project and I am kinda stuck



    What I want to do is pretty simple and we’ve all seen it 1000 times



    I want to have a timeline scrolled on my flash. So let say my movie has 1000 frames I want the bar to roll as the frames progress. I want to be able to grab the pointer and pull it to anywhere on the timeline and this will rewind/fast forward the movie – Something even similar to the scroll that is found on the bottom of youtube movies



    I would be great if someone could point me in the right direction – even possibly a tutorial



    Thank you

  2. #2
    SitePoint Guru Dijup's Avatar
    Join Date
    Jun 2006
    Location
    Kathmandu, Nepal
    Posts
    790
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can calculate the total no of frame and create a movie clip and maintain the ration of the width and put the scrub and detect the position of it and take our the frame position from there.

  3. #3
    RTFM ashleyk's Avatar
    Join Date
    Dec 2005
    Location
    Rochester, New York
    Posts
    435
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ---------------------------------------
    Ashley Kennedy
    ---------------------------------------
    how does a designer get roped into writing code?

  4. #4
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thankyou Dijup and ashleyk.

    I've got it the scrubber bar working okay. Still a couple of things I need to find out.

    -One, the tutorial mentions being able to make sthe equence continue to play after the handle is released. I'm not sure which code to alter to make this happen.

    -Two, I originally had several button on the main movie; a play, rewind, fast-forward and rewind and used this following script.

    play_btn.onRelease = function (){
    play();
    }
    pause_btn.onRelease=function(){
    stop();
    }
    forward_btn.onPress=function (){
    createEmptyMovieClip("controller_mc",1);
    controller_mc.onEnterFrame=function(){
    gotoAndStop(_currentframe+20);
    if (_currentframe+20 >_totalframes){
    gotoAndStop(_totalframes);
    }
    }
    }
    forward_btn.onRelease=function (){
    controller_mc.removeMovieClip();
    }
    forward_btn.onReleaseOutside=function (){
    controller_mc.removeMovieClip();
    }
    rewind_btn.onPress=function (){
    createEmptyMovieClip("controller_mc",1);
    controller_mc.onEnterFrame=function(){
    gotoAndStop(_currentframe-20);
    if (_currentframe-20 < 1){
    ;
    }
    }
    }
    rewind_btn.onRelease=function (){
    controller_mc.removeMovieClip();
    }
    rewind_btn.onReleaseOutside=function (){
    controller_mc.removeMovieClip();
    }
    I'm trying to find a way to have this and the scrubber work together.

    I motion tweened the scrubber handle to move from one side of the bar to the other, placing this scubber into a movie clip (named "scubber") within my main movie clip (named "main", which is where I placed the script in the quote box), and scretched it to the length of the main movie. This method kinda works, but the scubber handle will freeze in it's current position on the timeline when I press pause and stay there even after I press play. I'd liked to have it so we can the play button make the scrubber movie clip to playing so that it's always in synch with the timeline. Or if anyone can think of a better solution, I'd appreciate it.


Bookmarks

Posting Permissions

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