Hey, I’m trying to do the ease to effect where it slows down as it gets closer to the certain area. What i have is a white box with an instance name of nav. I have 5 buttons. When I click a button i want the white box to ease to these certain X, Y. So when someone clicks on 1 of the 5 buttons it goes to a certain X, y. Each of the 5 buttons takes it to a different location. I’ve tried a variety of actionscipting and each one is unsuccesful. How can I acheive this effect?
on your button:
[AS]on (release) {
_global.tarX = 250;
_global.tarY = 150;
}[/AS]
where tarX,tarY is the target position of your mc, so you can change this for the other buttons.
and on your mc:
[AS]onClipEvent (load) {
_global.tarX = 50;
_global.tarY = 50;
}
onClipEvent (enterFrame) {
this._x += (tarX-_x)/5;
this._y += (tarY-_y)/5;
}[/AS]
more on easing:
search the forums
Robert Penner
scotty:}
thanks man, I owe ya one.
no problem
the site im working on is www.obsidian-hosting.com if you want to check it out, its not done but its getting there.
*Originally posted by scotty *
**on your button:
[AS]on (release) {
_global.tarX = 250;
_global.tarY = 150;
}[/AS]
where tarX,tarY is the target position of your mc, so you can change this for the other buttons.
and on your mc:
[AS]onClipEvent (load) {
_global.tarX = 50;
_global.tarY = 50;
}
onClipEvent (enterFrame) {
this._x += (tarX-_x)/5;
this._y += (tarY-_y)/5;
}[/AS]
more on easing:
search the forums
Robert Penner
scotty:} **
Scotty, thank you very much, funny i am having such a huge problem. I currently switched over to Flash MX 2004 and my code to simply make movielcips move doesn’t work anymore. Gettin kinda cranky, but wait, behold, this code works fine, no AS errors.
Thanks Mang
LOL, you’re welcome:smirk:
scotty