Hi this is my first post so it would be great if someone could help.
i am trying to assign boolean variables to my script that i have made, basically i have never done it before so i have no idea how to add them to my script. i am controlling movieclips using alpha levels so when a key is pressed it makes a mc =100 and when the key is released it takes the alpha back down to 0. My mc work fine along with the keypresses, its just i need more control over what has already come up.
I want to use the boolean variables so that they control the mc and stop them from playing after a certain amount of times the key is pressed.
here is some of my script:
stop();
this.onEnterFrame = function() {
if (Key.isDown(65)) {
trace(“It’s an A”);
girl_mc._alpha = 100;
} else {
girl_mc._alpha = 0;
}
if ((Key.isDown(85)) && (Key.isDown(65))) {
trace(“It’s a U and an A”);
carnival2_mc._alpha = 100;
} else {
// if it’s not down
carnival2_mc._alpha = 0;
}
if ((Key.isDown(85)) && (Key.isDown(65)) && (Key.isDown(84))) {
trace(“It’s a U, T and an A”);
tree_mc._alpha=50, carnival2_mc._alpha=0, yo_mc._alpha=50;
} else {
// if it’s not down
tree_mc._alpha=0, yo_mc._alpha=0;
}
if ((Key.isDown(85)) && (Key.isDown(65)) && (Key.isDown(84)) && (Key.isDown(79))) {
trace(“It’s a U, O, T and an A”);
handy_mc._alpha=50, carnival2_mc._alpha=0, tree_mc._alpha=0, yo_mc._alpha=0;
} else {
// if it’s not down
handy_mc._alpha = 0;
}
};