# Simple Calling an array from inside a movieclip problem!

**URL:** <https://forum.kirupa.com/t/simple-calling-an-array-from-inside-a-movieclip-problem/260580>\
**Category:** flash\
**Created:** [May 16, 2008, 10:47pm UTC](https://forum.kirupa.com/t/simple-calling-an-array-from-inside-a-movieclip-problem/260580 "2008-05-16T22:47:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![four4swords](https://avatars.discourse-cdn.com/v4/letter/f/87869e/32.png) [@four4swords](https://forum.kirupa.com/u/four4swords)\
**Post date:** [May 16, 2008, 10:47pm UTC](https://forum.kirupa.com/t/simple-calling-an-array-from-inside-a-movieclip-problem/260580/1 "2008-05-16T22:47:39Z")

</div>

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

```auto

testarray = [99,554];

```

Now… from the Main timeline… i have this

```auto
 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](http://four4swords.110mb.com/OUT/Untitled-4.fla)

---

<div class="post-metadata">

**Author:** ![four4swords](https://avatars.discourse-cdn.com/v4/letter/f/87869e/32.png) [@four4swords](https://forum.kirupa.com/u/four4swords)\
**Post date:** [May 17, 2008, 10:39am UTC](https://forum.kirupa.com/t/simple-calling-an-array-from-inside-a-movieclip-problem/260580/2 "2008-05-17T10:39:21Z")

</div>

_bump_!

---

<div class="post-metadata">

**Author:** ![shotymac](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@shotymac](https://forum.kirupa.com/u/shotymac)\
**Post date:** [May 21, 2008, 8:07pm UTC](https://forum.kirupa.com/t/simple-calling-an-array-from-inside-a-movieclip-problem/260580/3 "2008-05-21T20:07:50Z")

</div>

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]);
