4 Replies Latest reply on Jul 7, 2012 9:57 AM by Ned Murphy

# Is it possible to make a button with multiple paths?

Hello and good day Everyone

I want to make a flash game with a map leading to various places for example school or beach like this http://www.yotreat.com/sites/default/files/190-160_1286.jpg

if the player goes to the school she will find the teacher, and if the player goes to the beach se will find the coach.

How can I make the player (for example) talks to the teacher at school, returns to the main map, and goes to the beach to talk with the coach, yet if she goes to the school again, the dialogue with the teacher won't be the same with first dialogue?

=>>> Is it possible to make a button with different paths to go? As if you've watched frame A, then you push the same button again it will take you to frame B??? <<<=

Sorry for my confusing description... I hope you get the idea >,<
Im so desperate... I've been searching for articles about this since yesterday and I still can't find one to solve this problem of mine.
Making games is my dream... I've made some very simple games, but I want to try a new level of difficulty

• ###### 1. Re: Is it possible to make a button with multiple paths?

Learning how to devise programming solutions requires learning what tools you have available to you and how you can manipulate them to suit your needs.  It doesn't matter if you are making games or whatever.

Only you know the details around your design idea, but there are probably a number of ways to manage having one button do different things.

One way could be to use an array of information (such as the frame numbers/labels) and have a counter that changes values when you use a button and that counter acts as the index for selecting an item from the array.  So when you start the counter/index is at 0, and it chooses the frames[0] of the frames array.  While processing that, the counter/index is incremented by 1 so that the next time frames[1] is selected.

This same type of approach could be used to keep track of how far one has gone in a series of interactions, such as when you want to have a conversation with a character pick up where it left off instead of starting over again.

The key to any of it is storing/keeping track of information.

• ###### 2. Re: Is it possible to make a button with multiple paths?

Thank you for the advice, sir Ned Murphy!

Yes, I try to use variables now, but face another problem with it... would you please tell me what's wrong with my script?

Here, in label: "School" I type:

on (release) {

if (point = 0){

gotoAndStop("dialogue1");

}

else if (point = 10){

gotoAndStop("dialogue2");

}

else {

gotoAndStop("dialogue3");

}

}

(it's only a testing, so I only use these 4 labels)

-------

and in label: "dialogue1", "dialogue2",and "dialogue3" I type:

on (release) {point += 10;}

on (release) {

_root.gotoAndStop("school");

}

-------

The result when I test movie:

1. At "School" (shows point=0), I click the button,

2. then occurs "dialogue2" (shows point=10), I click the button,
3. then back at "school" (shows point=20), I click the button,

4. then occurs "dialogue2" again (shows point=10)

even the first shot is wrong

point=0 should be the entrance to "dialogue1", but all I can get is "dialogue2"...

Please tell me what's wrong with my script, sir Ned Murphy,

Thank you very  much

Regards,
Tami

• ###### 3. Re: Is it possible to make a button with multiple paths?

Thank you very very very much sir Ned Murphy!
I finally find the script for my problem, it's:

on (release) {

stop ();

if (point == 0) {

gotoAndStop ("dialogue1");

}else if (point == 10) {

gotoAndStop ("dialogue2");

}else if (point == 20) {

gotoAndStop ("dialogue3");

}

}

Im so happy ^^
Thank you again sir Ned Murphy for answering my question, God bless you

• ###### 4. Re: Is it possible to make a button with multiple paths?

You're welcome Tami