Over 10 years of community discussion and knowledge are maintained here as a read-only archive.
var configProxy:MyAppConfigProxy = new MyAppConfigProxy();facade.registerProxy( configProxy ); configProxy.fetchConfig();
import org.puremvc.as3.utilities.flex.config.interfaces.IConfigVO;
import org.puremvc.as3.multicore.utilities.flex.config.interfaces.IConfigVO;
public class MyAppConfigProxy extends ConfigProxy { public function MyAppConfigProxy( configURL:String ){ super (configURL) } override protected function constructVO():IConfigVO { return new MyAppConfigVO(); } }
var configProxy:AppConfigProxy = new AppConfigProxy("config/config.xml");
var wFacade:ApplicationFacade = facade as ApplicationFacade;wFacade.app = note.getBody() as QuestWaver; var configProxy:WaverConfigProxy = new WaverConfigProxy("config/waver-config.xml");facade.registerProxy(configProxy);configProxy.retrieveConfig();
<fsm initial={App.STATE_CONFIGURING}> <state name={App.STATE_CONFIGURING} entering={AppFacade.CONFIGURE}> <transition action={ConfigProxy.SUCCESS} target={App.STATE_LOGGED_OUT} /> </state> <state name={App.STATE_LOGGED_OUT} entering={AppFacade.LOGIN}> </state></fsm>
override public function execute(notification:INotification):void { var appConfigProxy: AppConfigProxy = facade.retrieveProxy( ConfigProxy.NAME ) as AppConfigProxy; appConfigProxy.retrieveConfig();}
override public function execute(notification:INotification):void { facade.registerProxy( new AppConfigProxy() );}
override public function execute(notification:INotification):void { facade.registerMediator( new AppMediator( notification.getBody() as App ) );}
override protected function initializeMacroCommand():void { addSubCommand( PrepModelCommand ); addSubCommand( PrepViewCommand ); addSubCommand( InjectFSMCommand );}
public class AppConfigProxy extends ConfigProxy { public static const CONFIG_PATH: String = "config/app-config.xml"; public function AppConfigProxy() { super( CONFIG_PATH ); } override protected function constructVO(): IConfigVO { return new AppConfigVO( ); } }
<fsm initial={App.STATE_CONFIGURING}> <state name={App.STATE_CONFIGURING} entering={AppFacade.CONFIGURE}> <transition action={App.CONFIG_LOADED} target={App.STATE_LOGGED_OUT} /> </state> <state name={App.STATE_LOGGED_OUT} entering={AppFacade.LOGIN}> </state></fsm>
override public function execute(note:INotification):void { // the configVO will be passed on through with the // notification sent when the transition to the new state occurs var configVO:IConfigVO = IConfigVO( note.getBody() ); sendNotification( StateMachine.ACTION, configVO, App.CONFIG_LOADED );}