Over 10 years of community discussion and knowledge are maintained here as a read-only archive.
private function creationCompleteHandler():void { ApplicationFacade.getInstance(NAME).startup(this); dispatchEvent( new CreationCompleteEvent( CreationCompleteEvent.COMPLETE, Application.application.parameters ) );}
private function creationCompleteEventHandler(event:CreationCompleteEvent):void { sendNotification(ApplicationFacade.INIT_FLASHVARS, event.flashvars);}
package com.me.myapp.model{ import org.puremvc.as3.multicore.patterns.proxy.Proxy; /** * Parameters Proxy. * <P> * Maintains the parameters object that corresponds to * the <code>FlashVars</code> passed into the Application * via the OBJECT/EMBED tag in the HTML wrapper.</P> */ public class ParamsProxy extends Proxy { public static const NAME:String = "ParamsProxy"; /** * Constructor. */ public function ParamsProxy( params:Object ) { super ( NAME, params ); } /** * Get the vendorName parameter. */ public function get vendorName():String { return params.vendorName as String; } /** * Get the appName parameter. */ public function get appName():String { return params.appName as String; } /** * Get the appVersion parameter. */ public function get appVersion():String { return appVersion as String; } /** * The parameters supplied to the main application. * <P> * There are two sources of parameters: the query * string of the Application's URL, and the value * of the FlashVars HTML parameter.</P> */ public function get params():Object { return data as Object; } }}
package com.me.myapp{ import com.me.myapp.MyApp; import com.me.myapp.model.ParamsProxy; import com.me.myapp.view.ApplicationMediator; import org.puremvc.as3.multicore.interfaces.INotification; import org.puremvc.as3.multicore.patterns.command.SimpleCommand; /** * Startup. * * Creates and registers the initial Proxies and Mediators * * @param note the STARTUP notification */ public class StartupCommand extends SimpleCommand { override public function execute(note:INotification):void { // Retrieve the Application reference and register the ApplicationMediator var myApp:MyApp = note.getBody() as MyApp; // Register the ParamsProxy // It maintains the FlashVars and initial QueryString parameters facade.registerProxy( new ParamsProxy( myApp.parameters ) ); // Register the ApplicationMediator facade.registerMediator( new ApplicationMediator( myApp ) ); } }}
return params.appVersion as String;
return appVersion as String;