Posted By

gandreini on 02/05/11


Tagged

random array pick


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

gandreini
makeyko
Fakeham
timr
tamak


Pick a random item from an array


 / Published in: ActionScript 3
 

URL: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Math.html#random%28%29

  1. var randomItem:* = myArray[int(Math.random() * myArray.length)];

Report this snippet  

You need to login to post a comment.