# Problem with arrays

**URL:** https://forum.kirupa.com/t/problem-with-arrays/274760
**Category:** flash
**Created:** [November 4, 2008, 11:17am UTC](https://forum.kirupa.com/t/problem-with-arrays/274760 "2008-11-04T11:17:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![LeonardoZimbres](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/leonardozimbres/32/4035_2.png) [@LeonardoZimbres](https://forum.kirupa.com/u/LeonardoZimbres)
#### Post date: [November 4, 2008, 11:17am UTC](https://forum.kirupa.com/t/problem-with-arrays/274760/1 "2008-11-04T11:17:35Z")

</div>

I feel a little dumb, because the thing is very simple but Im not figuring out whats wrong.

I want to set an array value inside a function, but when I check this lenght in another function, the array is empty! Someone know whats wrong?

The code:

var AAny:Array = new Array()  
AAny = [“one”,“two”,“tree”]  
startComboBox(AAny)  
var aCbs:Array = new Array()  
function startComboBox(arr:Array):void {  
//aCbs=arr  
aCbs = arr  
trace(“len:”+aCbs.length); /////// OUTPUT:[COLOR=“Red”] len:3[/COLOR]  
cb\_first.addEventListener(MouseEvent.CLICK, moveComboBox);  
}

function moveComboBox(evt:MouseEvent):void {  
trace(aCbs.length+" dammit"); OUTPUT: [COLOR=“Red”]0 dammit[/COLOR]  
}//
