AS3 syntax question
Hi,
Having a syntax problem/question. When I write this in AS3, I get the correct result: 4
var wordArray1:Array = ["test","apple","orange","olive"];
var theLevel:Number = 1;
trace(root["wordArray" + theLevel].length);
but when I write it this way, inside a function, I get an error:
function test():void
{
var wordArray1:Array = ["test","apple","orange","olive"];
var theLevel:Number = 1;
trace(root["wordArray" + theLevel].length);
}
test();
I can't understand what I'm doing wrong? Any ideas?
