How do you do this effect?

http://www.iflashfx.com/

What is the actionscript for that rectangle that moves to the button you hover over, can anyone tell me the actionscript please?

Thanks.

Check your link, I don’t think it’s what you wanted.

Thanks Fred I changed the link go ahead and click it again :wink:

I don’t know the action script, but i know that you will want to use easing. I believe you tell the box to ease to the position of the mouse when you roll over a button. Do a search for easing on this forum and you will probably find quite a lot of info. Good luck, it is a cool effect.

On the movieclip that you want to ease into position, place this AS
[AS]
onClipEvent(load){
_root.tarX = initialxposition
_y = initialyposition
}
onClipEvent(enterFrame){
_x = _root.tarX-(_root.tarX-_x)/1.2
}
[/AS]

Change initialxposition and initialyposition to the x and y positions of where you want the movieclip to start. This could be on the first button, or on the left outside the stage, or anything.

To the buttons, add this code:
[AS]
on(rollOver){
_root.tarX = this.instancenameofbutton._x
}
[/AS]

There you go. You can also have the movieclip to change size smoothly (for example if one buttons is large and another is small), just ask and I’ll modify it :wink:

thanks guys :slight_smile: