Добрый день!
Я видимо чё-то не то съел, но не пойму, в чём проблема

Код AS3:
package object
{
import flash.display.Sprite;
import flash.events.Event;
import nape.phys.Body;
public class ControLocation extends Sprite
{
private var body:Body;
public function ControLocation(_body:Body)
{
body = _body;
if (stage)
init();
else
addEventListener(Event.ADDED_TO_STAGE, init); //до сюда, после создания экземпляра класса доходит, если добавить в след строку trace(999), то увидим вывод
}
private function init(e:Event = null):void
{
trace(123);//а этот корд не выполняется, т.е. даже trace не выводится
removeEventListener(Event.ADDED_TO_STAGE, init);
addEventListener(Event.ENTER_FRAME, location);
}
private function location(e:Event):void
{
if (body.position.x < stage.stageWidth * 0.02)
{
body.position.x = stage.stageWidth * 0.98 - 1;
}
if (body.position.x > stage.stageWidth * 0.98)
{
body.position.x = stage.stageWidth * 0.02 + 1;
}
if (body.position.y < stage.stageHeight * 0.17)
{
body.position.y = stage.stageHeight * 0.972 - 1;
}
if (body.position.y > stage.stageHeight * 0.972)
{
body.position.y = stage.stageHeight * 0.17 + 1;
}
}
}
}
ни на что не ругается