I’m building a Freecell type card game. I’ve got an array that loads all of the cards (actually, the linkage names for each card loaded from the library with attachMovie). I randomize the array before I “deal the cards” onto the stage.
Here’s a little code snipet where “deal” starts off equaling 0 and “cardDeck” is the value from my array (for example, c5 equals 5 of Clubs):
if (deal<52) {
_root.createEmptyMovieClip("card"+deal, deal);
_root["card" + deal].attachMovie(cardDeck[deal],cardDeck[deal],deal);
deal++
}
There’s more, of course. My problem is - How can I detect which card loaded into which movie? For example, I know I have a movie called _root.card6 at the bottom of the first column, how can I know what card is loaded into _root.card6?