[SIZE=2]Hi,
I’m building a memory game and am trying to build in a delay, a pause before a matching pair of cards is removed. I have tried almost every option given in any other post on this site but I can’t figure it out. I tried a simple “for” statement, timer events etc. but nothing works. Best case I get no compiler-errors and there simply happens…nothing. Can anybody please help me! Thx!!! This is the code I use:
I case you wonder what strange language it is, it’s Dutch and now I know why I shouldn’t have done that!
*// player clicks a card
public function klik_kaart(event:MouseEvent) {
var deze_kaart:Kaart_1 = (event.currentTarget as Kaart_1); // wich card?
if (eerste_kaart == null) { // first card
eerste_kaart = deze_kaart; // define the first card
eerste_kaart.gotoAndStop(deze_kaart.voorkant+2); // turn around first card
} else if (eerste_kaart == deze_kaart) {// first card is clicked again
eerste_kaart.gotoAndStop(23); // turn back the first card
eerste_kaart = null;
} else if (tweede_kaart == null) { // define the second card
tweede_kaart = deze_kaart; // this is the second card
tweede_kaart.gotoAndStop(deze_kaart.voorkant+2); // turn around second card
// compare the two cards
if (Math.floor(eerste_kaart.voorkant/2) == Math.floor(tweede_kaart.voorkant/2)) {
// remove a matching pair
removeChild(eerste_kaart)
removeChild(tweede_kaart)
// reset first card and second card to “null”.
eerste_kaart = null;
tweede_kaart = null;*
Greats, Marco.[/SIZE]