I’m tyring to get a movie clip to move from it’s current x, y
position to a designated x., y postion specified
in a button (onrelease).
But I need the movie clip to move at a constant rate regardless
of it’s distance traveled.
I can’t get it to work.
I’m having troble knowing which code to put where,
Button, object and frame.
Can anyone help?
code for the button:
on (press){
pathToTheMovieclip.gotoAndStop (2);
}
on (release){
pathToTheMovieclip.gotoAndStop (1);
}
[SIZE=1]note: the pathToTheMovieclip should look like that (example of a mc called ball on the main timeline) _root.ball[/SIZE]
On the mc:
1- create two identical frames;
2- on the second one place this code:
this.onEnterFrame = function(){
speed=3;
this._y+=speed;
}
[SIZE=1]note: speed variable could be set to any value you want, the _y is for vertical movement, if you want to move horizontally use _x[/SIZE]
=)