codice:
onClipEvent (enterFrame) {
   // o quando, lo decidi tu

   if (this._x<500) {
      this._x+=10;
   }

   if (this._x>500) {
      this._x-=10;
   }

   // analogamente per la _y
}
Sicuramente ci saranno soluzioni migliori...