Simple Calling an array from inside a movieclip problem!

hi

Here’s what i’m trying to do…

On my _root … maintimeline… i have a movieclip with instance name… “one”… and inside it… on the first frame… I have this array


testarray = [99,554];

Now… from the Main timeline… i have this

 trace(_root.one.testarray[0]);

By just reading it… it should output “99”… right?
But i just keep getting “undefined”!

Anyone know how to solve this?

Thanks!

*I’ve added the fla of this problem here - file size = 32kb
http://four4swords.110mb.com/OUT/Untitled-4.fla

bump!

Hey took a look at your file. The reason you are getting undefined is because your trace statement is being called before your array is being created. You can declare your array on the main timeline and then call the trace statement or move your trace statement inside of your movieclip after you declare the array instance. Either way the code will look like what is below. Hope this helps

Sean

stop();
testarray = [99, 554];
trace(testarray[0]);