# Why is this array broken?

**URL:** https://forum.kirupa.com/t/why-is-this-array-broken/198964
**Category:** flash
**Created:** [August 30, 2006, 3:03am UTC](https://forum.kirupa.com/t/why-is-this-array-broken/198964 "2006-08-30T03:03:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![red1000](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@red1000](https://forum.kirupa.com/u/red1000)
#### Post date: [August 30, 2006, 3:03am UTC](https://forum.kirupa.com/t/why-is-this-array-broken/198964/1 "2006-08-30T03:03:42Z")

</div>

Hello!

I have an array of 50 movieclips with 5 rows and 10 columns.

[Here is how I wanted it to look](http://defymedia.com/explanation.gif)

and

[URL=“[http://defymedia.com/explanation2.gif](http://defymedia.com/explanation2.gif)”]Here is how it currently looks

I have a flaw in the logic that is repeating the same row over and over, instead of increasing the value correctly.

Any ideas?!

Here is the code:

```auto
//init variables 
spacingx = 78; 
spacingy = 78; 
character._visible = 0; 
 
//open more info 
function DisplayInfo() { 
   menu_mc._visible = false; 
   infobox_mc._visible = true; 
   infobox_mc.content_txt.text = this.location_text; 
} 
 
//close more info 
infobox_mc.close_btn.onRelease = function() { 
   menu_mc._visible = true; 
   infobox_mc._visible = false; 
   infobox_mc.content_txt.text = ""; 
}; 
 
//create character array 
infobox_mc._visible = false; 
var item_count = 0; 
function CreateMenu(menu_xml) { 
   var items = menu_xml.firstChild.firstChild.childNodes; 
   for (var i = 0; i<items.length; i++) { 
      for (var j = 0; j<5; j++) { 
         if (items*.attributes.type == "user") { 
            var species = items*.firstChild; 
            var location = items*.childNodes[1]; 
            var item_mc = menu_mc.attachMovie("character", "item"+item_count, item_count); 
            item_mc._x = spacingx*i; 
            item_mc._y = spacingy*j; 
            item_count++; 
            item_mc.species_txt.text = species.firstChild.nodeValue; 
            item_mc.main_btn.location_text = location.firstChild.nodeValue; 
            item_mc.main_btn.onRelease = DisplayInfo; 
         } 
      } 
   } 
} 
 
//load xml 
var feed_xml = new XML(); 
feed_xml.ignoreWhite = true; 
feed_xml.onLoad = function(success) { 
   if (success) { 
      CreateMenu(this); 
   } else { 
      trace("Error loading XML file"); 
   } 
}; 
feed_xml.load("feed.xml"); 

```

Thanks!!
