actionscript
scripted movement
There are 6 buttons in the file and 1 movieclip.
Movieclip is supposed to be a "slider", which moves toward the certain button, when mouse is over that button.
The scrip is as follows:
//buttons array
var Buttons = new Array (6);
Buttons[0] = _root.frontsite;
Buttons[1] = _root.index05;
Buttons[2] = _root.events;
Buttons[3] = _root.lounges;
Buttons[4] = _root.about;
Buttons[5] = _root.contact;
// sliding func
function slide () {
speed=2;
zdesx =_root.slider._x;
_root.slider._x+=(xpos - zdesx)/speed;
}
function getx () {
xpos = getProperty(Buttons[i], _x);
}
for (var i = 0; i < Buttons.length; i++) {
Buttons[i].onRollOver = getx ();
_root.slider.onEnterFrame = slide();
}
That does not work.
Please tell me where did i go wrong? Thanx a lot in advance!
There are 6 buttons in the file and 1 movieclip.
Movieclip is supposed to be a "slider", which moves toward the certain button, when mouse is over that button.
The scrip is as follows:
//buttons array
var Buttons = new Array (6);
Buttons[0] = _root.frontsite;
Buttons[1] = _root.index05;
Buttons[2] = _root.events;
Buttons[3] = _root.lounges;
Buttons[4] = _root.about;
Buttons[5] = _root.contact;
// sliding func
function slide () {
speed=2;
zdesx =_root.slider._x;
_root.slider._x+=(xpos - zdesx)/speed;
}
function getx () {
xpos = getProperty(Buttons[i], _x);
}
for (var i = 0; i < Buttons.length; i++) {
Buttons[i].onRollOver = getx ();
_root.slider.onEnterFrame = slide();
}
That does not work.
Please tell me where did i go wrong? Thanx a lot in advance!
