Hi
I Have just started using Flash MX 2004 Professional. My big problem is I
want to load the three top 'cards' from a list of 40 cards which are
generated at random (which I have done using PHP code below).
<?
$cards[0] = 'card1';
$cards[1] = 'card2';
$cards[2] = 'card3';
$cards[3] = 'card4';
$cards[4] = 'card5';
$cards[5] = 'card6';
$cards[6] = 'card7';
$cards[7] = 'card8';
$cards[8] = 'card9';
$cards[9] = 'card10';
$cards[10] = 'card11';
$cards[11] = 'card12';
$cards[12] = 'card13';
$cards[13] = 'card14';
$cards[14] = 'card15';
$cards[15] = 'card16';
$cards[16] = 'card17';
$cards[17] = 'card18';
$cards[18] = 'card19';
$cards[19] = 'card20';
$cards[20] = 'card21';
$cards[21] = 'card22';
$cards[22] = 'card23';
$cards[23] = 'card24';
$cards[24] = 'card25';
$cards[25] = 'card26';
$cards[26] = 'card27';
$cards[27] = 'card28';
$cards[28] = 'card29';
$cards[29] = 'card30';
$cards[30] = 'card31';
$cards[31] = 'card32';
$cards[32] = 'card33';
$cards[33] = 'card34';
$cards[34] = 'card35';
$cards[35] = 'card36';
$cards[36] = 'card37';
$cards[37] = 'card38';
$cards[38] = 'card39';
$cards[39] = 'card40';
for($i = 0; $i < 40; $i++)
{
$count = count($cards);
$random = (rand()%$count);
if($cards[$random] == ""
{
$i--;
}
else
{
$deck[] = $cards[$random];
$cards[$random] = "";
}
}
srand(time());
$Z = (rand()%39);
for ($index = 1; $index < 4; $index++)
{
if ($Z == 3) { $Z = 0; }
$Card = $deck[$index];
$NewCards[] = $Card ;
$Z++;
}
;
$choice1 = $NewCards[0].".jpg";
$choice2 = $NewCards[1].".jpg";
$choice3 = $NewCards[2].".jpg";
echo "choice1=$choice1&choice2=$choice2&choice3=$choice3";
?>
I then want choice1, choice2 and choice3 to be sent to their respective
MovieClip positions which I have named holder_1, holder_2 and holder_3.
However I don't know the ActionScript to make this work.
This is my code attempt
loadVariables(" "GET"
;
loadMovie(" , _root.holder_1, "GET"
;
loadMovie("images/"+choice2 , _root.holder_2, "GET"
;
loadMovie("images/"+choice3 , _root.holder_3, "GET"
;
I Have just started using Flash MX 2004 Professional. My big problem is I
want to load the three top 'cards' from a list of 40 cards which are
generated at random (which I have done using PHP code below).
<?
$cards[0] = 'card1';
$cards[1] = 'card2';
$cards[2] = 'card3';
$cards[3] = 'card4';
$cards[4] = 'card5';
$cards[5] = 'card6';
$cards[6] = 'card7';
$cards[7] = 'card8';
$cards[8] = 'card9';
$cards[9] = 'card10';
$cards[10] = 'card11';
$cards[11] = 'card12';
$cards[12] = 'card13';
$cards[13] = 'card14';
$cards[14] = 'card15';
$cards[15] = 'card16';
$cards[16] = 'card17';
$cards[17] = 'card18';
$cards[18] = 'card19';
$cards[19] = 'card20';
$cards[20] = 'card21';
$cards[21] = 'card22';
$cards[22] = 'card23';
$cards[23] = 'card24';
$cards[24] = 'card25';
$cards[25] = 'card26';
$cards[26] = 'card27';
$cards[27] = 'card28';
$cards[28] = 'card29';
$cards[29] = 'card30';
$cards[30] = 'card31';
$cards[31] = 'card32';
$cards[32] = 'card33';
$cards[33] = 'card34';
$cards[34] = 'card35';
$cards[35] = 'card36';
$cards[36] = 'card37';
$cards[37] = 'card38';
$cards[38] = 'card39';
$cards[39] = 'card40';
for($i = 0; $i < 40; $i++)
{
$count = count($cards);
$random = (rand()%$count);
if($cards[$random] == ""
{
$i--;
}
else
{
$deck[] = $cards[$random];
$cards[$random] = "";
}
}
srand(time());
$Z = (rand()%39);
for ($index = 1; $index < 4; $index++)
{
if ($Z == 3) { $Z = 0; }
$Card = $deck[$index];
$NewCards[] = $Card ;
$Z++;
}
;
$choice1 = $NewCards[0].".jpg";
$choice2 = $NewCards[1].".jpg";
$choice3 = $NewCards[2].".jpg";
echo "choice1=$choice1&choice2=$choice2&choice3=$choice3";
?>
I then want choice1, choice2 and choice3 to be sent to their respective
MovieClip positions which I have named holder_1, holder_2 and holder_3.
However I don't know the ActionScript to make this work.
This is my code attempt
loadVariables(" "GET"
loadMovie(" , _root.holder_1, "GET"
loadMovie("images/"+choice2 , _root.holder_2, "GET"
loadMovie("images/"+choice3 , _root.holder_3, "GET"