PDA

View Full Version : help


xxyurirfxx
05-28-2003, 02:05 AM
hey i need a lil help on actionscript this is really simple but i just forgot hoy to do it..(yeah rigth).

ok i want this buton that is hidden to slide when i put the mouse over it. now heres what i got

the button is a log rectangle masked so only the tip is show
in the actionscript i got:
note:: the but instance name is but1

on (Rollover) {
but1._x = but1._x + 50;
}
on (rollout){
but1._x = but1._x -50;
}

now this works ok..when i put the mouse over it jumps to 50 but what i want is it to slide to 50 you know..nice and slowly

and the same with the roll out

thanks for your help

Yuri

spriggan
05-28-2003, 04:35 AM
put the button in a movie clip and animate the rollout and roll in. Put a stop(); in the first frame, then use this code:

on (Rollover){
mymovieclip.gotoAndPlay(2);
}


and for the roll out

on (Rollout){
mymovieclip.gotoAndPlay(what ever frame # where the rollout begins)
}


Replave mymovieclip with what ever the instance name of the clip is.

look at this tutorial http://www.actionscript.org/tutorials/beginner/Drop_down_menu/index.shtml

farafiro
05-28-2003, 08:32 AM
xxyurirfxx
welcome to the forums, if u wanna do it by ActionScript//this goes for a MC
var curX, tX, go; //this for target x position
button_mc.onRollOver = function() {
go = true;
tX = this._x+50;
};
button_mc.onEnterFrame = function() {
if (go) {
this._x += (tX-this._x)/10; //divide is just for some easing

}
};

xxyurirfxx
05-28-2003, 08:16 PM
not working :( is there any other way? with actionscript i mean

thanks for the help

farafiro
05-29-2003, 07:01 AM
r u sure it's not working