This content has been marked as final. Show 9 replies
Thank kglad. I have inserted the code that you gave but am now getting an error that I can't fix. I believe it may be because the _firstCard variable isn't defined for the function cardTurnF. Any clue?
I've attached the entire function that checks the cards and is supposed to flip them back over. Hopefully I placed the code in the correct places.
The error is:
TypeError: Error #1010: A term is undefined and has no properties.
you should use a counter that determines whether the call to checkMatch() is odd-numbered (assign _firstCard) or even-numbered (assign _secondCard and compare _firstCard and _secondCard and take the appropriate action depending upon the values or _types of the two cards).
I really don't understand what you mean kglad. I guess you are giving me a solution to my problem, but I don't know what your directions are leading me towards.
This tutorial is straight from lynda so I know a ton of people have used it, I just need an example to "reverse-engineer" to figure out how to delay the cards turning back over.
is checkMatch() called every time a card is turned?
Yes, it is. Every time there is a click.
I follow the logic behind what you did. However, I still can't get it to work. Now, none of the cards are created on the stage of the movie. At this point I think this may be something that I'll have to revisit later once I have more scripting under my belt. If I can find someone to take a look at the files I'll do that. Thanks for the help though.
the code i gave does not create any cards. the code you posted doesn't appear to create any cards.
the code i gave would test if a clicked card is the first or second card. if it's the 2nd it compares the two and takes appropriate action or has comments to prompt you to add code to take appropriate action.