Hello,
I have several arrays that are like this...
ch1sounds['test1.mp3', 'test2.mp3'...]
ch2sounds['test1.mp3', 'test2.mp3'...]
ch3sounds['test1.mp3', 'test2.mp3'...]
and I have the following expression to get the correct sound file to play
soundToLoad = "ch" + chapter+ "sounds[" + i + "]";
but this is returning for ch1sounds[0], and I need it to return the value of ch1sounds[0], which is test1.mp3. I tried the eval function and it's returning undefined.
What am I doing wrong?
Thanks in advance
I have several arrays that are like this...
ch1sounds['test1.mp3', 'test2.mp3'...]
ch2sounds['test1.mp3', 'test2.mp3'...]
ch3sounds['test1.mp3', 'test2.mp3'...]
and I have the following expression to get the correct sound file to play
soundToLoad = "ch" + chapter+ "sounds[" + i + "]";
but this is returning for ch1sounds[0], and I need it to return the value of ch1sounds[0], which is test1.mp3. I tried the eval function and it's returning undefined.
What am I doing wrong?
Thanks in advance