This is the MXML in a file called Client.mxml:
<?xml version="1.0" encoding="UTF-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" horizontalAlign="center" verticalAlign="center" initialize="ClientAction.Initialize()" >
</mx:Application>
This is ActionScript3 package in a file called ClientAction.as:
package { import mx.controls.Alert; import mx.core.Application;
public class ClientAction
{
public static function Initialize():void
{
if(ClientAction._action == null)
{
ClientAction._action =
new ClientAction(Application.application as Application);
}
}
public function ClientAction(thisApplication:Application)
{
//TODO: do some stuff with the root application.
}
private static var _action:ClientAction = null;
}
}