4 Replies Latest reply on Jun 8, 2006 7:30 PM by kglad

    Help With My Matching Game Array

      Im creating a simple matching game where user clicks on a red square, then they have to find the other red square and click on it, which is a match.

      The problem is that if I click on one button, it registers the value into the array (e.g. "red"). But then when I click the second button, the first value seems to be gone. Ideally element[0] and element[1] should both be the value of "red" after the two buttons are clicked. Then I can just use my conditional to see if they match.

      But everytime a button is clicked, the other element in the array reverts back to undefined. Is this a scope problem? Maybe my array is in the wrong place. Please help