Este es el código que tengo para hacer mover el sprite
CÓDIGO
onEnterFrame() {
if (Key.isDown(Key.RIGHT)) {
gotoSceneAndPlay("<current scene>",7);
this._x+=5;
} else {
if (Key.isDown(Key.LEFT)) {
gotoSceneAndPlay("<current scene>",7);
this._x-=5;
} else {
if (Key.isDown(Key.DOWN)) {
gotoAndPlay(8);
} else {
gotoAndPlay(1);
if (Key.isDown(Key.UP)) {
gotoAndPlay(9);
this._y-=5;
} else {
gotoAndPlay(1);
this._y-=0;
}
}
}
}
}
Pero que tengo que hacer para que cuando llegue a esos limites no se mueva mas allá