# Flash Memory/Match Game needs counter to end game

**URL:** <https://forum.kirupa.com/t/flash-memory-match-game-needs-counter-to-end-game/61924>\
**Category:** Uncategorized\
**Created:** [August 23, 2004, 12:40pm UTC](https://forum.kirupa.com/t/flash-memory-match-game-needs-counter-to-end-game/61924 "2004-08-23T12:40:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![emspott](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@emspott](https://forum.kirupa.com/u/emspott)\
**Post date:** [August 23, 2004, 12:40pm UTC](https://forum.kirupa.com/t/flash-memory-match-game-needs-counter-to-end-game/61924/1 "2004-08-23T12:40:04Z")

</div>

Please help, I have a Flash Memory Game completed.  
There are 36 cards face down, 18 pairs are to be found.  
you click the cards and upon matching - the cards go away.  
Game works great, but I need to install a way to let the game know when 18 matches have been made…thus ending the game with a ‘You Win’ message.  
I can not figure out how to tell the game the 18 matches have been made.  
Any suggestions would be greatly appreciated!  
Thanks so much!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 23, 2004, 7:38pm UTC](https://forum.kirupa.com/t/flash-memory-match-game-needs-counter-to-end-game/61924/2 "2004-08-23T19:38:34Z")

</div>

How did you construct your engine?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 23, 2004, 7:41pm UTC](https://forum.kirupa.com/t/flash-memory-match-game-needs-counter-to-end-game/61924/3 "2004-08-23T19:41:27Z")

</div>

If you have a (matched/unmatched) variables unique to each card, you can have the counter check the values of the variables on each frame using &&. If the check registers true, the win sequence will commence.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 23, 2004, 9:03pm UTC](https://forum.kirupa.com/t/flash-memory-match-game-needs-counter-to-end-game/61924/4 "2004-08-23T21:03:38Z")

</div>

so…

onClipEvent (enterFrame){  
if ((\_global.match1==0)&&(\_global.match2==0)&&(\_global.match3==0)){  
\_root.counter.stop();  
\_root.victory.play();  
}  
}
