I am also working on a tutorial for my flash game and this is how I have it set up. Each portion of the game checks a Tutorial object to check to see if an action is available for the player to do. If the tutorial module doesn't exist or is inactive, then we can assume that the player can do anything.
Using your Sim City game for example, let's say that when the tutorial starts you don't want the player to be able to do anything until the appropriate time. You could have flags in your tutorial object like, PLAYER_CAN_USE_TOOLBAR, PLAYER_CAN_SWITCH_VIEWS or PLAYER_CAN_DESIGNATE_ZONE etc all set to FALSE. As the player steps through your tutorial you can then start setting those flags to true.
For your UI portion, block the signal to the model or controller that actually performs the action if your tutorial flags aren't set:
// If our tutorial module/tracker exists, but the action flag is set to false
// then leave our method early
if (mTutorial.isActive() && !mTutorial.checkFlag(PLAYER_CAN_DESIGNATE_ZONE)) {
return false;
}
//Do the rest of the action here
For wating for specific events you could pass event back into your tutorial object to validate that is what the player needs to do to continue that tutorial step. For example, if you needed the player to create a residential zone at a particular X,Y:
var evt:GameEvent = new GameEvent(EVENT_CREATE_ZONE, ZONE_TYPE_RESIDENTIAL, startX, startY, endX, endY);
if (mTutorial.isActive()) {
if (!mTutorial.checkFlag(PLAYER_CAN_DESIGNATE_ZONE)) {
return false;
}
//Check to see if this event is okay
if (!mTutorial.validateEvent(evt)) {
//Show why the player can't do this via popup
return false;
}
}
//Do the rest of the action here
I hope that helped. Unfortunately, you'll have to add the tutorial checks into your old code to get this to work. But by assuming that all actions are valid unless the tutorial object exists should ease this integration process and allow you to minimize your bugs.