myMc.onRollOver = function() { if(this._x==100){ this.onEnterFrame = function() { this._x += (400-this._x)/4; }; }else{ this.onEnterFrame = function() { this._x += (100-this._x)/4; }; }; }