You are listening to the wrong event. Event.ADDED
will be fired when it's added to any display list. But you need to wait for Event.ADDED_TO_STAGE
before root
will be available to you:
public function Hero()
{
addEventListener(Event.ADDED_TO_STAGE, beginClass);
}