Hello!
I have an array of 50 movieclips with 5 rows and 10 columns.
Here is how I wanted it to look
and
[URL=“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:
//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!!