A Flash Developer Resource Site

+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Aug 2004
    Posts
    3

    Controlling Timeline with Slide Bar

    Could any one point me in the direction of a tutorial on Controlling a Timeline with Slide Bar, if they know of one please? Have read soome stuff that says its possible but cant find out how to do it.

    Cheers

  2. #2
    Re Member websam's Avatar
    Join Date
    Jul 2000
    Location
    Australia (VIC)
    Posts
    660
    Please refer to my demo.

    You may place the slider any where and scale it to any size without affecting its functionality at all.

    If you want to change it to control MCs rather than main timeline, just change one line of code by replacing "_root." to "_root.YourMC"

    Update:

    Modify the following line:
    fNum=int((nob._x-slot._x)/(slot._width-nob._width)*(totalFrame+1))+2;
    to
    fNum=int((nob._x-slot._x)/(slot._width-nob._width)*(totalFrame))+2;
    Attached Files
    Last edited by websam; 08-27-2004 at 09:49 AM.

  3. #3
    Junior Member
    Join Date
    Aug 2004
    Posts
    3

    thanx

    Thanx websam,

    much appreciated !

  4. #4
    Junior Member
    Join Date
    Oct 2007
    Posts
    1

    Can I set the slider nob to start at a certain frame?

    Hey Dave...

    Nice tut btw.

    I was wonderring if you can make the nob start at a certain frame in a mc in stead of having the nob at the beginning of the slot mc.

    I made it so that i control a mc's timeline and not the main timeline.

    Another problem...

    When I drag the nob away/out of the slot mc, release button and move back to the slot area, the nob still sticks to the pointer. And i change the one line of actionscript as u wrote under update.

    Hope I wrote it well enough. New to actionscript :S

    Thx in advance

    Christian

  5. #5
    Re Member websam's Avatar
    Join Date
    Jul 2000
    Location
    Australia (VIC)
    Posts
    660
    Hey there,

    Use the previous sample I made, and change the script on frame 2 to the following:

    Code:
    nob._x = slot._x + slot._width/2;
    nob._y = slot._y;
    fNum = Math.ceil(this._totalframes/2);
    _root.gotoAndStop(fNum)
    
    nob.onPress=function(){
    	startDrag(nob,0,slot._x,slot._y,slot._width+slot._x-this._width,slot._y);
    	this.onEnterFrame=function(){
    		fNum=Math.ceil((this._x-slot._x)/(slot._width-this._width)*(_root._totalframes));
    		if(fNum <= 2) fNum = 3;
    		_root.gotoAndStop(fNum);
    	}	
    }
    
    nob.onRelease = nob.onReleaseOutside = function(){
    	this.stopDrag();
    	delete this.onEnterFrame;
    }
    
    stop();
    It should work as you expected

    cheers
    Challenging you: I explore my strengths;
    Being challenged: I discover my weaknesses;
    Defeating you: I GIVE you my knowledge;
    Being defeated: I GAIN your knowledge;

  6. #6
    Re Member websam's Avatar
    Join Date
    Jul 2000
    Location
    Australia (VIC)
    Posts
    660
    If you want to control your own MC on main timeline, all you need to do is to change _root.gotoAndStop(fNum) to your_MC.gotoAndStop(fNum)

    and change _root._totalframes/this._totalframes to your_MC._totalframes

    cheers
    Challenging you: I explore my strengths;
    Being challenged: I discover my weaknesses;
    Defeating you: I GIVE you my knowledge;
    Being defeated: I GAIN your knowledge;

  7. #7
    Senior Member
    Join Date
    Sep 2002
    Posts
    119
    Hi,
    I am trying to use this sample however I am finding problems to make the slide to move while the movie plays.

    I have made something kinda oughul taking tue % of movement of the timeline and applying it to the slider but is not good.

    Does anybody known how could I accomplish this movement and keep the slider working while grabbing it?

    Thanks lot.
    Jose
    JºC3

  8. #8
    Junior Member
    Join Date
    Apr 2008
    Posts
    3
    yeah, I'd really, really like to know how to do that too!
    I need to have a movieclip playing and be able to go backward a forward in the timeline, exactly like in videos and music =)
    please, please help!

  9. #9
    Junior Member
    Join Date
    Dec 2012
    Posts
    1
    WebSam, I used your slide control for a project prototype and was very pleased. The project may need to be in Actionscript 3 though... have you created a version for 3 at all? It's a wonderful thing and I like to try and keep it. Thanks, matt

Posting Permissions

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




Click Here to Expand Forum to Full Width


HTML5 Development Center