View Full Version : Scroll bar rotation
ok here is my dilemma, i have an object that was created with 8 pics frame by frame, what i want to do is create a scroll bar so that a user can drag it and turn the object in either direction. i have found scroll bar tutorials but all for text, please help, this may be a simple task but i cant seem to find help for it
THOR
[Edited by THOR on 05-04-2001 at 12:40 PM]
When you make your movie clip for the scroll button offset the graphic from the center so that when you place the movie clip on stage it's center will be such that the graphic is in the default position on screen and the '+' marking the center of the movie clip will be at x=0 (or y=0 depending on which way you want to scroll). This will make the arithmatic simpler.
Next work out the range your graphic will scroll. Say it scrolls 400 pixels.
400/8 = 50. i.e. 400/50 = 8
So for every 50 pixels you scroll you will add one frame to your calculation if you use;
frmNr = Math.ceil(_root.scroller._x/50);
_root.images.gotoAndStop(frmNr);
So in general;
range = Number of pixels in the scroller range.
frms = number of frames in movie clip with images.
constant = range/frms
gotoAndStop = Math.ceil(range / constant)
~mgb
[Edited by mgb on 05-04-2001 at 03:20 PM]
thanks, i owe ya, works great!
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.