Check var

hi,

i have made a small test for myself for checking vars.

i have made 3 buttons:

  • green
  • blue
  • send

they al stand on frame 1. on frame 10 stands a var text field named “blok” and on frame 15 stand the text “error try again”.

On frame 1 stands this script:

stop();
_root.blok = "none";

When you press the green button and then the send button you go to frame 10 and in the text field appears “green”. (same with the blue one)

But when you press inmidiatly the send button you must go to frame 15 that shows the error.

it works fine with this script: (but only for 1 color)

on (release) {
    if (blok eq "green") {
        gotoAndStop(15);
    } else {
        blok = "";
        gotoAndStop(30);
    }
}

How can i make this work for more colors? Or do i need another script for that?

thx,

Snake