I'm creating my first as3 with flashdevelop I don't understand what the instructions mean:
package
{
import flash.display.Sprite;
import flash.events.Event;
public class Main extends Sprite
{
public function Main():void
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point
}
}
}
What if (stage) init(); means ? What is Event.ADDED_TO_STAGE ? Why remove listener in init ?