public function moveHero(x:int,y:int,hero:DisplayObject):void { // например проверяем на препятствие if (isValidPoint(x,y)) { hero.x=x; hero.y=y; } }