all groups > flash actionscript > september 2004 >
You're in the

flash actionscript

group:

Easy Horizontal slider?



Re: Easy Horizontal slider? captainnimster NO[at]SPAM tokyopop.com
9/7/2004 2:52:35 PM
flash actionscript: checkout the tutorials here:
http://www.actionscript.org/tutorials.shtml

or here:
http://www.kirupa.com/developer/

[quoted text, click to view]
Re: Easy Horizontal slider? _jrh_
9/7/2004 4:24:07 PM
Put this in the button (in this case, I put it on a movie clip instance - same
idea):

onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
this.startDrag(false, slideMin, this._y, slideMax, this._y);
}
}

onClipEvent (mouseUp) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
this.stopDrag();
}
}

Where slideMin and slideMax are the bounds for the drag.
Easy Horizontal slider? ....James Smith
9/7/2004 10:43:03 PM
I was just wondering how i would go about making a horizontal scroll bar
that can only move lets say a maximum of 20 pixels to the right of the
orgin.

Thanks in Advance

Re: Easy Horizontal slider? _jrh_
9/8/2004 1:53:30 AM
Yeah. Add this:

// on main timeline
slideMax = 294.4; // same as the other slideMin and max
slideMin = 14.4;
ratio = (slideMax-slideMin)/100;

onClipEvent(enterFrame) {
// checks and stores the value every frame
percent = Math.round(this._y* _root.ratio);
}
Re: Easy Horizontal slider? ....James Smith
9/8/2004 10:22:34 AM
Thanks for that. Just another quick question would you know how to make the
slider store a value between 0 and 100 depending where the scroll bar is on
the screen?



[quoted text, click to view]

AddThis Social Bookmark Button