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: StateMachine - A PureMVC Haxe Utility  (Read 22775 times)
zjnue
Jr. Member
**
Posts: 17


View Profile Email
« on: December 13, 2008, 07:54:24 »

This utility provides a simple yet effective Finite State Machine implementation, which allows the definition of discrete states, and the valid transitions to other states available from any given state, and the actions which trigger the transitions.

A mechanism is provided for defining the entire state machine in XML and having a fully populated StateMachine injected into the PureMVC app.

Standard and MultiCore versions are included.

The demo has historically been located here: http://trac.puremvc.org/Utility_Haxe_StateMachine
The project has been moved here: https://github.com/PureMVC/puremvc-haxe-util-statemachine/wiki

It was ported to Haxe by Zjnue Brzavi.
« Last Edit: September 22, 2012, 02:49:59 by puremvc » Logged
simon_ustwo
Newbie
*
Posts: 5


View Profile Email
« Reply #1 on: June 04, 2009, 08:52:09 »

Hi,

I've run into a small problem, when entering a state I want to have the ability to change to a new state, but because the "currentState" hasn't been set we're left in a weird state of having no state at all.

StateMachine.hx

// Enter the next State
if( nextState.entering != null ) sendNotification( nextState.entering, nextState );
currentState = nextState;

I would like to change it to:

// Enter the next State
currentState = nextState;
if( nextState.entering != null ) sendNotification( nextState.entering, nextState );


This will fix the issue I'm seeing. Note I'm using this in neko and this could be only present in this.

thoughts?
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #2 on: June 04, 2009, 01:54:11 »

That would probably be because the StateMachine utility needs to be upgraded to match the current AS3 reference version. This is a problem that existed in 1.0.

Ping the author, Zjnue,  about this. There is a link to his contributor page on the Haxe StateMachine project page.

Also, Zjnue: The trunk of the AS3 version contains the latest code, which will be published as 1.2 shortly. If you upgrade follow the code in the trunk.

-=Cliff>
« Last Edit: June 04, 2009, 01:56:36 by puremvc » Logged
simon_ustwo
Newbie
*
Posts: 5


View Profile Email
« Reply #3 on: June 05, 2009, 08:24:04 »

Cheers, I'll let him know.
Logged
zjnue
Jr. Member
**
Posts: 17


View Profile Email
« Reply #4 on: June 06, 2009, 04:33:07 »

Hi guys,
Thanks for the ping. I can look at it a little later this weekend.
Cheers
Logged
zjnue
Jr. Member
**
Posts: 17


View Profile Email
« Reply #5 on: June 11, 2009, 12:30:49 »

Updated StateMachine trunk and tagged it as 1.2. Please see if you are happy with that Cliff.
Logged
Pages: [1]
Print