PDA

View Full Version : Vertical Slider Menu



slayerment
March 11th, 2003, 01:32 AM
Does anybody know how this slider increases in speed gradually as you move your cursor left or right? I've been looking through the code and can't really figure it out.
http://www.actionscript.org/tutorials/advanced/ADVANCED_SLIDER_MENU/index.shtml
Thanks!

DeV
March 11th, 2003, 04:17 PM
I don't know about that specific .fla but perhaps this could help;

onClipEvent (load)
{
xcenter=150;
//the center of the scroling movie

speed=1/10;
// the normal speed in wich the movie will move
}


onClipEvent (enterFrame)
{
var distance=_root._xmouse-xcenter;
//this gets the distance of the mouse from the disignated center of the movie
_x+=(distance*speed);
//this applies the appropriate motion as a ****ing of speed and distance from the conter
}


Hope that helps :smirk:

lostinbeta
March 11th, 2003, 05:50 PM
Originally posted by DeV
I don't know about that specific .fla but perhaps this could help;

onClipEvent (load)
{
xcenter=150;
//the center of the scroling movie

speed=1/10;
// the normal speed in wich the movie will move
}


onClipEvent (enterFrame)
{
var distance=_root._xmouse-xcenter;
//this gets the distance of the mouse from the disignated center of the movie
_x+=(distance*speed);
//this applies the appropriate motion as a ****ing of speed and distance from the conter
}


Hope that helps :smirk:


Aka....

http://www.kirupa.com/developer/mx/infinite.htm

telekinesis
March 11th, 2003, 05:56 PM
Look at frame 2 in the scripts layer where it tells you:


startDrag("dragControl", true);

And then there is a movie clip with an instance name of dragControl so click on it and view the script on frame 1:


drag = "/dragControl";
/:w = getProperty("/nav", _width);
/:xPos = getProperty(drag, _x);
/:yPos = getProperty(drag, _y);
/:yPos = /:yPos - 200;
/:xPos = /:xPos - 350;
speed = 45;
setProperty("/nav", _x, getProperty("/nav", _x) - (/:xPos / speed));
if (Number(getProperty("/nav", _x)) < Number(-(/:w / 2))) {
setProperty("/nav", _x, 0.01);
} else if (Number(getProperty("/nav", _x)) > 0) {
setProperty("/nav", _x, -/:w / 2);
}

The speed is in there and the you can edit it with that, hope this helped!

By the way, this is all Flash 4 syntax so it looks very messy!

DeV
March 11th, 2003, 08:21 PM
Originally posted by lostinbeta
Aka....

http://www.kirupa.com/developer/mx/infinite.htm


well... yea

slayerment
March 11th, 2003, 08:25 PM
WOW GUYS! YOU ALL RULE! THIS WORKS LIKE A CHARM! :) :)