Within the enterFrame handler, add the following conditional test. This test needs to go within the block of code that gets executed when a match occurs. Currently, these three lines get executed:
matchList.add(flippedList[1])
matchList.add(flippedList[2])
flippedList = []
You want to place the conditional test following these three lines so that the cards are added to matchList before you test it. Add the if statement:
if matchList.count() = 16 then
_movie.go("gameOver")
end if
Now, as soon as the final match is made and all the cards added to matchList, the movie will jump to the gameOver markerwhich you are about to create. |