random range for gui button

how can i make the cardlist.cardList be a random number/card?

here’s my code
var cardlist;
var tableTracker;
cardlist = GameObject.FindWithTag(“MainCamera”).GetComponent(“cardListing”);
tableTracker = GameObject.FindWithTag(“MainCamera”).GetComponent(“TableCardTracker”);
var totalCardsInStack = 54;
function OnGUI ()
{
GUI.BeginGroup (new Rect (Screen.width / 2 - 400, Screen.height / 2 - 300, 800, 600));
for(var i :int = 0;i <= 2; i++)
{
totalCardsInStack = GUI.Button(Rect(100i,10,100,150),cardlist.cardList);*
if (cardlist.cardList*)*
{

}
}
GUI.EndGroup ();
}

You can use Random.Range() to produce a random number between two values.

If you’re trying to grab a random list element, you’ll probably want a number n between 0 and the list’s length so that you can grab list[n].