Pick a random item from an array


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. var randomItem:* = myArray[int(Math.random() * myArray.length)];

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.