I just created a quick memory example from scratch. It's nothing to look at, just plain colored cards and it's also not commented. I'm using an Array object, HashTable object and the Function object. You probably should be familiar with those in order to understand this example (consult wiki).
The X/Y Size of the array defines the number of cards. Not too different from the puzzle tutorial I create the cards from that array. I randomize it so that there will be 2 of every possible card by using the hashtable (adding and deleting keys from it in a certain manner). You'll see there are different loops and some math with Globals involved which might look confusing on first sight. But it's nothing too complicated really.
There may always be a better method to do this. At least this is a lot less of a hassle than the old version I did over a year ago. Anyway, I hope it's helpful to you.