Quantcast
Channel: Adobe Community : All Content - Adobe Animate CC - General
Viewing all articles
Browse latest Browse all 13519

Nested Arrays: Syntex help needed

$
0
0

In my spelling game I have Levels of 10 words in each level and each word has to be broken up into its phonetic sounds. Because I'm working with phonetic sounds, I can not simply split the word up into letters - so I had to do each word manually according to its sounds (not individual letters).

 

Here are the first five words of level 1, each split as I want it:

 

public var  wordsL1W1:Array = ["e","l',"e","ph","a","nt" ];

public var  wordsL1W2:Array = ["h","a","s"];

public var  wordsL1W3:Array = ["o","f"];

public var  wordsL1W4:Array = ["o","ff"];

public var  wordsL1W5:Array = ["o","n"];

 

I would like to add them all to a nested array (named wordsL1) so that I can manipulate the array as a whole e.g. loops and things. Here is how I wrote it:

 

public var  wordsL1:Array = [wordsL1W1,wordsL1W2,wordsL1W3,wordsL1W4,wordsL1W5];

 

And when I trace it like below I expect the following in the output box: e,l,e,ph,a,nt

 

     trace(wordsL1[0]);

 

BUT I get //null in the output pannel

 

What did I do wrong?

 

Thanks

Charine


Viewing all articles
Browse latest Browse all 13519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>