hansolo Posted August 23, 2010 Share Posted August 23, 2010 // Ive created an array with three items.Button named random btn is to give the result of a random number of one, two, three. // Now the result after the button is pressed is only selecting one random number out of the three. Then the button is repeats the result each time the button is pressed.as an example say the number one is chosen number one. Press the random btn and thats the only number which is choosen.var targetArray:Array = new Array("one", "two", "three");// this makes a random numbervar randomNum = random(targetArray.length);randomBtn.onPress = function(){trace(randomNum);}hansolo is online now Report Post Edit/Delete Message Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.