Search code examples
actionscript-3apache-flexflash-builderflex3

How to store and compare multiple movieclips array values


I am creating a card game application in that dynamic movieclips created on stage and inside those movieclips different cards can drop, which have some values.

If one movieclip contains one card and another movieclip contained two cards and all the other movieclips 3rd,4th,5th.. etc contains some cards then, if i want to go back and want to drop another card at the top of the old one, than how i can do this, because when i go back and drop a new card inside movieclip than it replaces the old one. i don't want to create a new array for each movieclip.

please help me..

Thanks


Solution

  • If you are concerned about the messiness of too many arrays, nest each one in an encompassing array like this:

    var allMovieClips : Array = new Array([card1, card2, card3], [card4, card5], [card6, card7, card8])
    

    I don't know the specifics of your program, but maybe this can help.