what if I wanted this MC to move at a steady pace,
then once it reached its destination ..
maybe faded out? .. or start back at the begining?
is that possible?

thanks,
-dan

Quote Originally Posted by jbum
I think you're asking if you can use it on a script which is on the main timeline. Yes you can. Let's say there is a movieclip called 'mc'. Here is a more fleshed out version of that script.

code:

mc.target = 200;
mc.speed = 2;

mc.onEnterFrame = function()
{
var dx = this.target - this._x;
if (Math.round(dx) == 0)
{
this._x = this.target;
delete this.onEnterFrame;
}
else {
this._x += dx / this.speed;
}
}