4 Replies Latest reply on Aug 23, 2007 8:14 PM by nandoo19

    Card game

    nandoo19
      I want to randomly flash 13 cards on screen. How do I do it using action script? I do not want to create an image of all 52 cards. want them to be created dynamically. Can anybody help?. I am using flash mx.
        • 1. Re: Card game
          BarryGee Level 1
          nandoo19.

          Create an array that containes the values 1-9, j, q, k, ace, create a second array that contains suits, hearts, spades, clubs, diamonds. randomly select an entry from the number array and an entry from the suit array , create a movieclip (thecard) and duplicate this for each card require by using duplciateMovieClip . The card movieclip should contain dynamic text boxes, fill the text boxes with the randomily chosen array values. put all of this within a for loop to and limit the loop as so

          for(i=0, i<12, i++){
          //code here
          }

          this way only 13 cards will be created.

          Barry.
          • 2. Re: Card game
            Level 7
            ++ Barry ++ wrote:
            > nandoo19.
            >
            > Create an array that containes the values 1-9, j, q, k, ace, create a second
            > array that contains suits, hearts, spades, clubs, diamonds. randomly select an
            > entry from the number array and an entry from the suit array , create a
            > movieclip (thecard) and duplicate this for each card require by using
            > duplciateMovieClip . The card movieclip should contain dynamic text boxes, fill
            > the text boxes with the randomily chosen array values. put all of this within a
            > for loop to and limit the loop as so
            >
            > for(i=0, i<12, i++){
            > //code here
            > }
            >
            > this way only 13 cards will be created.
            >
            > Barry.
            >


            Should be i<=12.
            • 3. Re: Card game
              nandoo19 Level 1
              Thanx Barry
              • 4. Re: Card game
                nandoo19 Level 1
                Thanx sherry