Question about random and arrays.
I want to make an array with words for example "one", "two", "three".
Then randomly choose one of the array elements and then show it in "number.text" after that, element would be deleted.
Can You give any examples please, cause I get this error all the time:TypeError: Error #1034: Type Coercion failed: cannot convert "One" to Array.
Code:
stage.addEventListener(Event.ENTER_FRAME, newWord);
function randomArrayElement(wordArray:Array):*{
return wordArray[Math.floor(Math.random()*wordArray.length)];
function newWord (e:Event):void {
var wordArray:Array = new Array ("One", "Two", "Three");
var posA:Array=randomArrayElement(wordArray);
word.text = String(posA);