Mmmm I have just been looking at my ranking for some Google searches.
I have come to the conclusion, that for an ActionScript Developer working in Brighton with both ActionScript 2 and ActionScript 3 in Flash, Flex and Air, I don’t mention the fact enough.
I mean, if you put “Brighton Flash Developer”, “Brighton Flex Developer”, “Brighton Air Developer”, I just don’t show at all! Even “Brighton AS3 Developer” gets Nada.
So, I guess I need to be a little more proactive in my choice of words….
In the spirit of community, I am posting a list of AS3 developers whom I would personally recommend, should I (obviously top of this list) not be available.
These are top guys, contact them now!
These guys are all members of the award nominated social network of FlashBrighton
Bit masks are good for managing many boolean values within a class. For example, here is a theoretical Alert class, which can show any combination of five buttons: OK, YES, NO, CANCEL, MAYBE. Instead of creating a boolean property for each of these, we can store all this info on one property (in this example the flags property).
Firstly, for readability, we can map each button type to an uint as an enumerated constant:
public static const AlertButtons.OK:uint = 1; public static const AlertButtons.YES:uint = 2; public static const AlertButtons.NO:uint = 4; public static const AlertButtons.CANCEL:uint = 8; public static const AlertButtons.MAYBE:uint = 16;
then, these constants can be applied to the flags property using the bitwise OR operator ( | ).
myAlertBox.flags = ( AlertButtons.YES | AlertButtons.NO | AlertButtons.MAYBE )
We can then test the flags property against the enumerated value for each button using the bitwise AND operator ( & ).
if (flags & AlertButtons.OK) trace("OK"); if (flags & AlertButtons.YES) trace("Yes"); if (flags & AlertButtons.NO) trace("No"); if (flags & AlertButtons.CANCEL) trace("Cancel"); if (flags & AlertButtons.MAYBE) trace("Maybe");
have moved the UnifiedLoader and the StateMachine into the multicore.utilities package
Have implimented a few changes to the State Machine recomended by Cliff. Most changes are hidden, but they do include a class name change from StateNotificationNames to StateConstants and with in it, the constant CHANGE_APPLICATION_STATE has changed to CHANGE_STATE.
Shorter and more friendly.
*Update see this post for the latest version*
Here is an implementation of a simple State Machine for pureMVC that I whipped up for a project. This is really useful for anyone creating applications, honest, its saved my life a few times :) It suddenly occurred to me that because its so simple I’ve been taking its power for granted, and I should share it for the greater geek good. I’ve been using it in combination with trilec’s command chaining utility as a way of controling my command structures.
Have put the code in the svn on my google code page and will prepare a download when I’ve documented it.
Initiate the StateMachine
// instanitate var stateMachine:StateMachine = new StateMachine(); // register with the facade before registering any commands facade.registerMediator(stateMachine); // create a state var state:State = new State(ApplicationStates.STATE_ONE) // register the commands to be triggered when // entering and exiting that state stateMachine.registerStateChangeCommands(EnterStateOne, ExitStateOne, state); // repeat for each state (this can be done any time) state = new State(ApplicationStates.STATE_TWO) stateMachine.registerStateChangeCommands(EnterStateTwo, ExitStateTwo, state);
This is very simple, just send a notification from anywhere within the pureMVC framework with a new state as its body:
// create a state var state:State = new State(ApplicationStates.STATE_TWO) sendNotification(StateNoteNames.CHANGE_APPLICATION_STATE, state))
[kml_flashembed movie=”http://www.revisual.co.uk/uploads/2008/oct/statemachine/state_machine_demo.swf” height=”300″ width=”470″ /]
OK, I’ve decided on a code name of Domino for my pureMVC command chaining utility. Because of the toppling analogy and cause I like it.
Now I can spend weeks working on all the icons for it before writing any code (tee hee)
Have started on some tutorials for the UnifiedLoader here.