I made a class, which has to register to the Event.RENDER event so that it will know when the stage is being rendered. The simplified version of my code looks like this:
package
{
import flash.events.Event;
import flash.display.Sprite;
public final class Test extends Sprite
{
public final function Test()
{
addEventListener(Event.ADDED_TO_STAGE,added,false,0,true);
}
private final function added(event:Event):void
{
trace("added to stage");
stage.addEventListener(Event.RENDER, renderHandler,false,0,true);
}
private final function renderHandler(event:Event):void
{
trace("Event.RENDER dispatched!");
}
}
}
The Event.ADDED_TO_STAGE event is being dispatched. However, the Event.RENDER event is not. Any idea what I may be doing wrong here? The parent is adding this object as a child to the stage, so that can't be the problem.