Game control HELP NEEDED

[font=Arial][size=3]Hi all![/size][/font]

[font=Arial][size=3]I need some help from the forum please since I am a newbie![/size][/font]

[font=Arial][size=3]I have two squares, one_mc and two_mc on the main timeline.[/size][/font]

[font=Arial][size=3]Beneath them I have three dots, a_mc, b_mc and c_mc, which reside on the main timeline as well. I also have on the main timeline an mc called”alphabet_mc” where I have the letters a,b,c under corresponding labels (label a inside alphabet_mc is where letter “a” resides, etc). The letters inside alphabet_mc are bitmap pictures, not textfields.[/size][/font]

[font=Arial][size=3]If the user presses one_mc and a_mc (or a_mc and one_mc)I want the letter “a” to appear at the corresponding label of alphabet_mc. Automaticaly I want the rest of the dots (b,c) to be disabled, since I do not want the user to press a second letter, but the corresponding number (for instance 1a)… However if the user presses two _mc I want the REST OF THE AVAILABLE DOTS of the previously pressed pair (in this case b,c) to be enabled so that the user can chose one of them along with two_mc ( for instance two_mc and b_mc so that b will appear on alphabet_mc).[/size][/font]

[font=Arial][size=3] [/size][/font]

[font=Arial][size=3]My problem is that I can not control the disabling of mc’s. How can I control which button the user will press and their outcome?[/size][/font]

[font=Arial][size=3]Also, when I add the same code to two_mc (with some name changes corresponding to two_mc and not to one_mc) the code gets confused. So how do I control the two numbers since they are sharing common letters?[/size][/font]
[font=Arial][size=3]Or perhaps, is there a better and easier way of achieving this that my own way?[/size][/font]
[font=Arial][size=3] [/size][/font]

[font=Arial][size=3]Your help is so much appreciated, since I am very stuck.[/size][/font]

[font=Arial][size=3]This is the code so far placed on the main timeline:[/size][/font]

[font=Arial][size=3] [/size][/font]

[font=Arial][size=3]function pressHandler() {[/size][/font]

[font=Arial][size=3] // disable if the user is already at the required label. [/size][/font]

[font=Arial][size=3] this.gotoAndStop(“pressed”);[/size][/font]

[font=Arial][size=3] this.enabled = false;[/size][/font]

[font=Arial][size=3] this.useHandCursor = false;[/size][/font]

[font=Arial][size=3] switch (true){[/size][/font]

[font=Arial][size=3] //–1A------------------------[/size][/font]

[font=Arial][size=3] case ( _root.a_mc.enabled == false) && ( _root.one_mc.enabled == false) :[/size][/font]

[font=Arial][size=3] _root.b_mc.enabled = false;[/size][/font]

[font=Arial][size=3] _root.c_mc.enabled = false;[/size][/font]

[font=Arial][size=3] _root.alphabet1_mc.gotoAndStop(“a”);[/size][/font]

[font=Arial][size=3] break;[/size][/font]

[font=Arial][size=3] //–A1–[/size][/font]

[font=Arial][size=3] case (_root.a_mc.enabled == false) && (_root.b_mc.enabled == true) && (_root.c_mc.enabled == true):[/size][/font]

[font=Arial][size=3] if (_root.one_mc.hitTest(_root._xmouse, _root._ymouse, true)) {[/size][/font]

[font=Arial][size=3] _root.one_mc.enabled = false;[/size][/font]

[font=Arial][size=3] _root.alphabet1_mc.gotoAndStop(“a”);[/size][/font]

[font=Arial][size=3] }[/size][/font]

[font=Arial][size=3] break;[/size][/font]

[font=Arial][size=3] //–1B-----------------------[/size][/font]

[font=Arial][size=3] case ( _root.one_mc.enabled == false) && ( _root.b_mc.enabled == false):[/size][/font]

[font=Arial][size=3] _root.a_mc.enabled = false;[/size][/font]

[font=Arial][size=3] _root.c_mc.enabled = false;[/size][/font]

[font=Arial][size=3] _root.alphabet1_mc.gotoAndStop(“b”);[/size][/font]

[font=Arial][size=3] break;[/size][/font]

[font=Arial][size=3] //–B1–[/size][/font]

[font=Arial][size=3] case (_root.a_mc.enabled == true) && (_root.b_mc.enabled == false) && (_root.c_mc.enabled == true):[/size][/font]

[font=Arial][size=3] if (_root.one_mc.hitTest(_root._xmouse, _root._ymouse, true)) {[/size][/font]

[font=Arial][size=3] _root.one_mc.enabled = false;[/size][/font]

[font=Arial][size=3] _root.alphabet1_mc.gotoAndStop(“b”);[/size][/font]

[font=Arial][size=3] }[/size][/font]

[font=Arial][size=3] break;[/size][/font]

[font=Arial][size=3] //–1C----------------------[/size][/font]

[font=Arial][size=3] case ( _root.one_mc.enabled == false) && ( _root.c_mc.enabled == false):[/size][/font]

[font=Arial][size=3] _root.a_mc.enabled = false;[/size][/font]

[font=Arial][size=3] _root.b_mc.enabled = false;[/size][/font]

[font=Arial][size=3] _root.alphabet1_mc.gotoAndStop(“c”);[/size][/font]

[font=Arial][size=3] break;[/size][/font]

[font=Arial][size=3] //–C1–[/size][/font]

[font=Arial][size=3] case (_root.a_mc.enabled == true) && (_root.b_mc.enabled == true) && (_root.c_mc.enabled == false):[/size][/font]

[font=Arial][size=3] if (_root.one_mc.hitTest(_root._xmouse, _root._ymouse, true)) {[/size][/font]

[font=Arial][size=3] _root.one_mc.enabled = false;[/size][/font]

[font=Arial][size=3] _root.alphabet1_mc.gotoAndStop(“c”);[/size][/font]

[font=Arial][size=3] }[/size][/font]

[font=Arial][size=3] break;[/size][/font]

[font=Arial][size=3] [/size][/font]

[font=Arial][size=3] //–case “a” pressed ONLY then “b” and “c” enabled.FALSE–[/size][/font]

[font=Arial][size=3] case ( _root.one_mc.enabled == true) && ( _root.a_mc.enabled == false) && ( _root.b_mc.enabled == true) && ( _root.c_mc.enabled == true) :[/size][/font]

[font=Arial][size=3] _root.b_mc.enabled = false;[/size][/font]

[font=Arial][size=3] _root.c_mc.enabled = false;[/size][/font]

[font=Arial][size=3] _root.alphabet1_mc.gotoAndStop(1);[/size][/font]

[font=Arial][size=3] break;[/size][/font]

[font=Arial][size=3] //–case “b” pressed ONLY then “a” and “c” enabled.FALSE–[/size][/font]

[font=Arial][size=3] case ( _root.one_mc.enabled == true) && ( _root.a_mc.enabled == true) && ( _root.b_mc.enabled == false) && ( _root.c_mc.enabled == true) :[/size][/font]

[font=Arial][size=3] _root.a_mc.enabled = false;[/size][/font]

[font=Arial][size=3] _root.c_mc.enabled = false;[/size][/font]

[font=Arial][size=3] _root.alphabet1_mc.gotoAndStop(1);[/size][/font]

[font=Arial][size=3] break;[/size][/font]

[font=Arial][size=3] //–case “c” pressed ONLY then “b” and “a” enabled.FALSE–[/size][/font]

[font=Arial][size=3] case ( _root.one_mc.enabled == true) && ( _root.a_mc.enabled == true) && ( _root.b_mc.enabled == true) && ( _root.c_mc.enabled == false) :[/size][/font]

[font=Arial][size=3] _root.b_mc.enabled = false;[/size][/font]

[font=Arial][size=3] _root.a_mc.enabled = false;[/size][/font]

[font=Arial][size=3] _root.alphabet1_mc.gotoAndStop(1);[/size][/font]

[font=Arial][size=3] break;[/size][/font]

[font=Arial][size=3] }[/size][/font]

[font=Arial][size=3]}[/size][/font]

[font=Arial][size=3] [/size][/font]

[font=Arial][size=3] [/size][/font]

[font=Arial][size=3]a_mc.onRelease = pressHandler;[/size][/font]

[font=Arial][size=3]one_mc.onRelease = pressHandler;[/size][/font]

[font=Arial][size=3]c_mc.onRelease = pressHandler;[/size][/font]

[font=Arial][size=3]b_mc.onRelease = pressHandler;[/size][/font]

[font=Arial][size=3]//two_mc.onRelease = pressHandler2a;[/size][/font]

[font=Arial][size=3]stop();[/size][/font]

i suggest you post your .fla if possible. It’ll be easier for us to help you.

–EP

Hallo! A bit of more explanation which I hope makes sense:
The user in general should select a number and a letter to have a letter apear ina the corresponding alphabet_mc.
A selection between a letter and a letter is not possible, neither a selection between a number and a number.
What I want to achieve through an example:
When user presses 1_mc and a_mc, letter “a” from alphabet1_mc apears.
Automaticaly, 1_mc and a_mc get disabled so that they can not be pressed again or get unpressed.
Also b_mc and c_mc get disabled since I do not want them to be pressed along with 1a which is already selected.
Then for instance, if the user presses 2_mc, then b_mc and c_mc get enabled again
so that the user will be able to select a letter. Let’s say we select c_mc, so letter “c” from alphabet2_mc apears,
and b_mc gets disabled so that it won’t be pressed along with 2c which is already selected.
WHAT I WANT TO AVOID HERE
while (for instance) 1_mc and a_mc are pressed and letter “a” apears (as in the example above)…
let’s say…if the user presses 2_mc, SINCE a_mc is already pressed, I do not want the letter "a"
to apear from alphabet2_mc. So, now three movie clips are presed, 1_mc, 2_mc, and a_mc.
However, 1_mc and a_mc were the first to be pressed, so letter “a” from alphabet1_mc apears and no matter.
if the user has pressed 2_mc as well, I do not want alphabet2_mc to show any letter.
But then, if the user presses c_mc while 2_mc is pressed, then I want the letter “c” to apear in alphabet2_mc.
The user in general should select a number and a letter to have a letter apear ina the corresponding alphabet_mc.
A selection between a letter and a letter is not possible, neither a selection between a number and a number.

So, how do I achieve all that? I am so confused…
Thank you for your help…
:slight_smile:
(I am using Flash MX, not Flash MX 2004)

Okay, here’s a demo file.
I completely redid your code, because it was getting more complex than was probably necessary.

Hope this is what you wanted.

–EP

He’s not going to be able to use that fla cus its MX2004 he says at the bottom of his last post that he’s using MX not MX2004

oh poo, you’re right, i’ll fix it when i get off work today.

Thanks,

–EP

Okay, here’s the file saved in MX format.
Hope it works, I can’t check it because I don’t have Flash MX anymore.

Enjoy,

–EP

Hi! Thank you very much for the file. It is kind of what I need, but unfortunately I can not understand this: What is (!this), what is boxToFill. Could you please explain me the code in words and what it does and how i can manipulate it?

function setChoice(obj, letter) {
if (!this.choice1) {
this.choice1 = obj;
this[this.boxToFill].gotoAndStop(letter);
this[this.choiceToEnable].enabled = true;
} else {
this.choice2 = obj;
this[this.boxToFill].gotoAndStop(letter);
}
for (k in letters) {
letters[k].enabled = false;
}
}

I need to add more numbers and more letters (24 number mcs and 24 letter mcs). How do I do that, and how do I control if a specific letter and number combination is correct, so that the uset gets one point? For instance, if the user presses 20a and “a” apears in letter20, I want the user to get one point.

Also for some number-letter combinations, NOT ALL, I want two replicas of the same letter mc to apear. For instance in the case of “1a” I want two letter1 mcs to exist on stage, so as when the user presses 1a I want the letter “a” to apear in both letter1 mcs which will sit next to each other. This is not the case for all combinations, but in some cases I want to be able to do that.

Please please help me, I am very stuck and new to this and need your help.

Thank you for everything. If you could answer to me as soon as possible that would be sooooooooooo great.