Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Using FSM with muti-core,  (Read 8440 times)
reduxdj
Jr. Member
**
Posts: 11


View Profile Email
« on: November 10, 2009, 02:23:40 »

Is there an example of this, I am having issues getting my FSM injected..

multitonKey for this Notifier not yet initialized!


How do I register this mediator with the multicore framework in the FSM please.

Thanks,
Patrick
Logged
reduxdj
Jr. Member
**
Posts: 11


View Profile Email
« Reply #1 on: November 10, 2009, 02:59:29 »

Here's the multicore version: http://puremvc.org/pages/docs/AS3/Utility_AS3_StateMachine/asdoc-multicore/index.html


my bad, however, the FSM doesn't initialize, because in my onRegister method I am trying to send the notification to initiate my FSM and my facade says it's null:

   
         // Create and inject the StateMachine
         var injector:FSMInjector = new FSMInjector( fsm );
         injector.inject();

So in line 51 of my FSM it fails:    facade.registerMediator( stateMachine );

why would my facade be null after it starts up at this point?

Logged
reduxdj
Jr. Member
**
Posts: 11


View Profile Email
« Reply #2 on: November 10, 2009, 03:15:39 »

However this works for me:

ApplicationFacade.getInstance(MyApp.NAME).registerMediator(stateMachine);
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 on: November 10, 2009, 04:37:09 »

because in my onRegister method I am trying to send the notification to initiate my FSM and my facade says it's null

In the onRegister method of what?

I typically use an InjectFSMCommand and I send a notification to trigger it from within my StartupCommand, after registering Proxies and Mediators.

-=Cliff>
« Last Edit: November 10, 2009, 04:40:04 by puremvc » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #4 on: November 10, 2009, 04:41:37 »

And that code that injects the StateMachine needs to be modified slightly in MultiCore:

:
// Create and inject the StateMachine
var injector:FSMInjector = new FSMInjector( fsm );
injector.initializeNotifier(this.multitonKey);
injector.inject();
Logged
Pages: [1]
Print