Skip to main content
Participant
August 20, 2007
Question

Card game

  • August 20, 2007
  • 2 replies
  • 283 views
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.
This topic has been closed for replies.

2 replies

Inspiring
August 20, 2007
++ 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.
nandoo19Author
Participant
August 24, 2007
Thanx sherry
August 20, 2007
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.
nandoo19Author
Participant
August 24, 2007
Thanx Barry