Over 10 years of community discussion and knowledge are maintained here as a read-only archive.
from http://trac.puremvc.org/Utility_AS3_StateMachine/wiki/ReleaseNotes:Passing data between States. When sending a StateMachine.ACTION notification, you may include any Object as the body of the notification and it will be included in the state-specific 'exiting', 'entering', and 'changed' notifications. This allows, for instance, the data collected from a UI form in the 'DATA_ENTRY' state to be passed to the 'DATA_SAVING' state when the form's 'Save' button is pressed, for instance.
A more 'real-world' demo will be forthcoming.
However, I'm full-on busy at the moment, I just can't say, though I wish I could. If it weren't for the pesky business of having to actually do other stuff for a living I'd get way more done here.
I was actually thinking about this as I was waking this morning. Its an important thing to get out there and will happen.
Don't hold your breath on the demo. I'm steaming on a project that you'll all hear much more about very soon. I will be working on something, but spare time is low right now.
Where is the most appropriate place to list the State/Action state machine constants for your application for a strictly AS3 implementation? I'm thinking is should be the main application facade.
The examples I have found are all Flex based and I've seen the constants placed in the main flex application file (StopWatch example) and then in the main application facade in the most recent LoginFSM example.
Also, being a newbie to AS3 and PureMVC, the LoginFSM has a nearly one-to-one correlation between notification constants, states and actions. In a typical PureMVC implementation this would not necessarily be the case since there are only a finite number of application states to move between but a vast amount of application notifications between all the Mediators, Controllers and Proxies depending on your application's complexity. Not all the application notifications are going to affect the state. I am looking more for an affirmation of what I just stated as opposed to trying to make a statement. Do I have it right?
public class MainState extends AbstractState{public static const NAME:String = "MainState";public static const ENTER:String = "Enter" + NAME;public static const EXIT:String = "Exit" + NAME;public static const CHANGED:String = "Changed" + NAME;public static const GOTO:String = "Goto" + NAME;}
Also, what is behind the convention of appending notification names with "actions/", "states/" etc. Again, it seems to imply a direct correlation between notifications and state changes and I'm pretty sure that is not going to be the case in the real world. It looks like any application notifications that also trigger state changes would be best served by this "appending" naming convention.
I understand the simplicity of the LoginFSM demo, but as someone who is "green" to PureMVC, I want to be sure that I am interpreting things correctly.Ultimately I am asking if I am interpreting things correctly.Any input would be appreciated, even if it's just "You're on the right path."(If I get the hang of PureMVC over the next few weeks I will probably put together a bit more comprehensive AS3-only demo)Thanks!