this.onEnterFrame = function() {
if (Key.isDown(39)) {
//右
_xscale = -100;
_x += 5;
this.gotoAndStop("walk");
} else if (Key.isDown(37)) {
//左
_xscale = 100;
_x -= 5;
this.gotoAndStop("walk");
} else if (Key.isDown(38)) {
//上
_y -= 5;
this.gotoAndStop("walk");
} else if (Key.isDown(40)) {
//下
_y += 5;
this.gotoAndStop("walk");
} else {
this.gotoAndStop("stay");
}
};
|