Using Prana's CairngormFrontController The Prana Framework comes with a Cairngorm FrontController implementation that can use configured via an application context.
<object id="applicationController" class="org.pranaframework.cairngorm.CairngormFrontController"> <constructor-arg> <object> <property name="login" value="LoginCommand"/> </object> </constructor-arg> <constructor-arg value="goodeats.command"/> </object>
One less ActionScript class to create and maintain in your own source code. When using this implementation, make sure you have a variable reference to this object in your main Application class.
<mx:Script> <![CDATA[ import org.pranaframework.cairngorm.CairngormFrontController; import org.pranaframework.context.support.XMLApplicationContext; private var _applicationContext:XMLApplicationContext; private var _cairngormFrontController:CairngormFrontController;
private function onCreationComplete() : void { _applicationContext = new XMLApplicationContext("application-context.xml"); _applicationContext.addEventListener(Event.COMPLETE, onApplicationContextComplete); _applicationContext.load(); }
private function onApplicationContextComplete(event:Event) : void { _cairngormFrontController = _applicationContext.getObject("applicationController") as CairngormFrontController; } ]]> </mx:Script>
|
|