Alo
Having problems with the following script. What the script is supposed to do is, first find out if the variable name text is the length of for letters, then if it is check to see if the 4 letters is found in an array called buttons. If yes added one to attempts, if not add one to ****e.
At the moment its adding 2 to attempts everytime i click a button, and the array check doesnt work.
here is the code for the frame:
// Defines array buttons
var buttons = new Array(“b1b2”,“b2b1”);
//Checks to see if text equals array
clickaction = (text == buttons*)
//Function for clicked buttons
clickedbutton = function (){
if (text.length == 4){
for (var i=0 ; i < buttons.length ; i++){
if (clickaction){
trace(“attempt is good”);
attempts++
text = “”
}else{
****e++;
text = “”
}}}}
On the buttons i have added this script:
on (release) {
text = text + “b1”;
clickedbutton();
}
Where am i going wrong?? i am so baffeled at the moment
:q: