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;
}
}




Reply With Quote