mc.vx=0; mc.onEnterFrame=function(){ this.vx+=Key.isDown(Key.RIGHT)?1:-1*(this.vx>0); this._x+=this.vx; }