var speed:Number = 5; clip.onEnterFrame = function() { this._rotation += speed; if (this._rotation > 90) { this._rotation = 90; speed = -speed; } if (this._rotation < -90) { this._rotation = -90; speed = -speed; } };