onEnterFrame script moving issue!
Hello!
I use this code on a mc to make it move to a y possition:
Code:
onClipEvent(load)
{
_root.ypos1=Stage.height/2;
}
onClipEvent(enterFrame)
{
this._y+=(_root.ypos1-this._y)/3;
}
To make it move to y = 20 i use this code on a button:
Code:
on(press){
_root.ypos1=20;
}
As you can see the movment will go from a fast speed and then slow down.
My question is; Can you make the movement go from 0 then increase and then "break" and stop when it has reached "ypos1=20"?
Thanks in advance!