PDA

View Full Version : draggable timeline


vurple
03-15-2007, 01:52 AM
Hi,
Is there any tutorial and source file to do something like this:
http://www.bbc.co.uk/wales/now/sites/orchestra/pages/history.shtml

Thank heaps!

safir187
04-07-2007, 01:55 PM
I have done it before. here it is:

-create a seeker movieclip (like a circle) and name it slider. then paste the following code in its actions.
-monitor movieclip is the MC that contains movie which should be controlled.
-line is the seekbar movieclip.
-dragging:Boolean shows if the seeker is being dragged or not.
-playing:Boolean shows if the monitor is being played or not.


on(press) {
_root.dragging = true;
startDrag(false,left, top, right, bottom);
}
on(release, releaseOutside) {
stopDrag();
_root.monitor.gotoAndPlay(Math.floor(((_root.slide r._x-line._x)/line.width)*_root.monitor._totalframes));
_root.monitor.play();
_root.dragging = false;
_root.playing=true;
}


-Read the codes carefully and make changes if necessary.
-Paste this one in the first frame of main movie.


if (!dragging) {
tot = monitor._totalframes;
lod = monitor._currentframe;
slider._x = int((lod/tot)*line.width)+line._x;
}else if(dragging){
monitor.gotoAndStop(Math.floor(((_root.slider._x-line._x)/line.width)*_root.monitor._totalframes));
}