Eigene Initialisierung

Overview
You can run custom initialization code in Main before Gaia loads the first branch. This initialization code can be asynchronous and anything you want. If you're going to load a file or anything else that would take time, you might want to give some feedback to the user to let them know the site is not frozen.

init
After Gaia parses the site.xml and loads the preloader, it calls init. If you override init in your Main class, you can run any code you want before Gaia calls the first goto. It's sort of like a mini hijack. Because the site.xml is loaded and parsed, you have full access to the site tree and initial site variables. This means you could load some custom asset xml and call addAssets to any page instead of using indexFirst.

Do not call super.init.

initComplete
When you're done, you call initComplete. initComplete is called similarly to releaseGaia in the Event Hijacking engine. You can run asynchronous code, like loading a file, before you call initComplete.

Do not override initComplete.

Syntax
Here is the basic syntax for using custom initialization.

AS3
override protected function init:void {   // do whatever you want initComplete; }

AS2
private function init:Void {   // do whatever you want initComplete; }