# Arrays in a function HELP!

**URL:** <https://forum.kirupa.com/t/arrays-in-a-function-help/241701>\
**Category:** flash\
**Created:** [October 17, 2007, 7:40am UTC](https://forum.kirupa.com/t/arrays-in-a-function-help/241701 "2007-10-17T07:40:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bboypapi](https://avatars.discourse-cdn.com/v4/letter/b/838e76/32.png) [@bboypapi](https://forum.kirupa.com/u/bboypapi)\
**Post date:** [October 17, 2007, 7:40am UTC](https://forum.kirupa.com/t/arrays-in-a-function-help/241701/1 "2007-10-17T07:40:05Z")

</div>

I having trouble accessing an array that I created in a function, outside of the function.

```auto

myData.onLoad = function(){
   var i;
   for (i=0; i<myData.idCount; i++) {
        //Current Item
	var current_item:Array = new Array();
	current_item* = myData["id"+i];
        //this trace works
        trace(current_item*);
    }
}

//this trace does not work!
trace(current_item*);		

```

I’m guessing it has to do with the scope of the array but I can’t figure out how to export the array so that it can be used on outside of the function, and more importantly, other .swfs

Any help would be great :thumb2:
