large array with vocab words
can anyone help me diagnose this file? nothing is outputted.
var r_text = new Array ();
phraseCnt = r_text.length;
var i = Math.floor(phraseCnt*Math.random())
That should show you why it isn't working, and the solution is to use this instead.
EDIT: I totally missed the Math.floor() when I read that the first time. It works fine for me like that, provided that you have all the values filled in.
As a side note, it would be easier for you to declare your array using JSON.
var r_text = ["no. 1", "no. 2", "no. 3" /* etc. */];
Last edited by Declan1991; 08-09-2010 at 08:30 PM.
Provided that there are no gaps in the subscripting, I don't see anything wrong and it does run.
Did you really write r_text[n]= 'word' 5000 times?
i actually have vocab words in there. so it's a long string, not just one word.
fixed. i had a stray quotation mark at the 319th array.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)