Hi,
It would be nice if you put some files for to see that you can actually do something other than demanding answers to questions that you have made no effort towards.
Similar to the last question I answered for you, only this time you might need to make an array of the cards and then swap the value of this for its proper card to display it as a picture card!!!.
PHP Code:
var clipArray:Array = new Array();
for (var i:int = 0; i < 50; i++)
{
var movieClip:Object = {value:Number(i + 1)};
clipArray.push(movieClip);
}
function getCards(arr:Array,k:int):void
{
var randNum:int;
var theTemp:Array = arr.concat();
var theHand:Array = new Array();
for (var j:int = 0; j < k; j++)
{
if (theTemp.length == 0)
{
break;
}
randNum = Math.floor(theTemp.length * Math.random());
theHand.push(theTemp.splice(randNum,1)[0]);
// *** Below optional, for sorting high to low
//theHand.sortOn(['value'], [Array.DESCENDING | Array.NUMERIC]);
}
for (var s:int = 0; s < theHand.length; s++)
{
var t:Number = s + 1;
trace("Card: " + t + " - " + theHand[s].value);
}
}
getCards(clipArray,12);
example, convert the value of the outcome against its associative card array