Hello I am having a big problem with one of my game projects. It is a game adventure set in a busy nightclub area. Basically you have to talk to people to advance throughout the game.

Because I cannot grasp how to do my game as a programmer as I consider myself more of a designer/Animator I work best with a view of what I am doing instead of coding from scratch.

I work with the timeline and use instances dragged on stage so I can understand how I want the game to look I know this is messy and impractical but it is easier to implement for me. I am working with Movieclips instead of classes if you understand.

Each state at the bottom is a different set of dialogues for one character so state1 would involve a conversation with the main character and another. So Kyle (A) talking with a Taxi driver. State A would be conversation 1. If the main character speaks to a specific character that is needed to advance the game, then when that conversation is ended with a button called closechat it will change states of all characters so that they all adapt to the advancing of the game.

Imagine multiple characters as separate entities and imagine the states on separate frames of the character movieclips.

LAYERS OF ACTIONSCRIPT:

• Music is just a loop
• Background deals with the scrolling of background
• Player moves the character
• Dialogue is used to determine where Kyle is hit testing with another character
• Characters layer involves mouseEvents if there is a hit test for specific character is true do this:

[CODE]
function talkToTaxiMan(event:MouseEvent) {
if (characterNo7) {
DIALOGUE.gotoAndStop("TAXIMAN");
kyle.gotoAndStop("standDown");
}
[CODE]


This is repeated code and brings up the movieclip DIALOGUE as an interaction


Bottom of screen is a button called closeChat which makes the DIALOGUE movieclip gotoandStop to frame label “blank” this removes from view and nothing appears, to enable continuation of game. If you talk to someone else it will gotoandstop to another dialogue for a character.

This is all fine and if you want to use this to create your own game that’s fine. However I have a problem changing the states of the game. E.G From state0 to state1.

I cannot seem to change the states because it is a child of dialogue. I put this in dialogue movieclip on the frame.


[CODE]
if (_state == 0)
{
TaxiState.gotoAndStop("STATE0");
}
else if (_state==1)
{
TaxiState.gotoAndStop("STATE1");
}
else if (_state==2)
{
TaxiState.gotoAndStop("STATE2");
}
else if (_state==3)
{
TaxiState.gotoAndStop("STATE3");
}
else if (_state==4)
{
TaxiState.gotoAndStop("STATE4");
}
else if (_state==5)
{
TaxiState.gotoAndStop("STATE5");
}
else if (_state==6)
{
TaxiState.gotoAndStop("STATE6");
}
[CODE]

It will not change the frame in the child of dialogue so I cannot change the state of conversations. Very frustrating. This is the code I used to change the state from frame 1 on dialogue on different layer.
var _state:int = 0;

closeChat.addEventListener(MouseEvent.CLICK, clearChat);

function clearChat(event:MouseEvent)
{
if (currentFrameLabel == "GIRLS" && _state==0)
{
_state++;

if (_state==0)
{
GirlsState.gotoAndStop("STATE2");
}
else if (_state==1)
{
trace("yes");
GirlsState.gotoAndStop("STATE3");
}
else if (_state==2)
{
GirlsState.gotoAndStop("STATE2");
}
else if (_state==3)
{
GirlsState.gotoAndStop("STATE3");
}
else if (_state==4)
{
GirlsState.gotoAndStop("STATE4");
}
else if (_state==5)
{
GirlsState.gotoAndStop("STATE5");
}
else if (_state==6)
{
GirlsState.gotoAndStop("STATE6");
}
}

gotoAndStop("NONE");
}

Below it does not change the states? How can I change them? Sorry for such a long article