Over 10 years of community discussion and knowledge are maintained here as a read-only archive.
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" xmlns:view="com.me.myapp.*" creationComplete="initApp()" > <mx:Script> <![CDATA[ import org.puremvc.patterns.observer.Notification; import com.me.myapp.ApplicationFacade; private var facade:ApplicationFacade = ApplicationFacade.getInstance(); private function initApp():void { facade.notifyObservers( new Notification( ApplicationFacade.STARTUP, this ) ); } ]]> </mx:Script> <!-- Top level controls and containers of app go here--></mx:Application>
public function startup( app:Object ):void{ notifyObservers( new Notification( STARTUP, app ) );}
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" xmlns:view="com.me.myapp.*" creationComplete="facade.startup(this)" > <mx:Script> <![CDATA[ import com.me.myapp.ApplicationFacade; private var facade:ApplicationFacade = ApplicationFacade.getInstance(); ]]> </mx:Script> <!-- Top level controls and containers of app go here--></mx:Application>
import com.me.myapp.ApplicationFacade;ApplicationFacade.getInstance().startup( _root );
package { import flash.display.MovieClip; import org.puremvc.as3.demos.flash.helloflash.ApplicationFacade; public class HelloFlash extends MovieClip { public function HelloFlash() { ApplicationFacade.getInstance().startup( this.stage ); } }}
package { import application.ApplicationFacade; import flash.display.Sprite; public class Main extends Sprite { private var facade:ApplicationFacade; public function Main() { facade = ApplicationFacade.getInstance(); facade.sendNotification(ApplicationFacade.STARTUP, this); } }}