I guess this might seem like a simple question, but I’ve scrambled my brain trying to figure it out, how do i get the it to create a new row after every 5th movieclip :S, so it would create a grid of movie clips, 5 colums, the rows dependant on how many entries in the XML file.
fscommand("allowscale", "false");
function load_xml(success)
{
if (xmlStuff.loaded)
{
listcount = xmlStuff.childNodes;
InjectData();
AddNumber();
} // end if
} // End of the function
function AddNumber()
{
itemMax = xinfo.length - 1;
itemCounter = 0;
_root.itemThumb = xicon[0];
for (i = 0; i <= itemMax; i++)
{
mload.attachMovie("tabItem", "tabItem" + i, i);
mload["tabItem" + i]._x = 46 * i;
mload["tabItem" + i].itemName = xname*;
mload["tabItem" + i].itemThumb = xicon*;
mload["tabItem" + i].itemDesc = xinfo*;
mload["tabItem" + i].itemLink = xlink*;
if (i < 9)
{
mload["tabItem" + i].itemNum = "0" + (i + 1);
continue;
} // end if
mload["tabItem" + i].itemNum = i + 1;
} // end of for
} // End of the function
function InjectData()
{
xname = new Array();
xinfo = new Array();
xicon = new Array();
xlink = new Array();
for (k = 0; k <= listcount.length; k++)
{
if (listcount[k].nodename == "item")
{
xname.push(listcount[k].attributes.name.toString());
xicon.push(listcount[k].attributes.icon.toString());
xinfo.push(listcount[k].attributes.info.toString());
xlink.push(listcount[k].attributes.link.toString());
} // end if
} // end of for
} // End of the function
xmlFile = "menu_images.xml";
xmlStuff = new XML();
listcount = new Array();
xmlStuff.load(xmlFile);
xmlStuff.onload = load_xml;
my XML file below, simplified.
<item
name="Kat"
icon="kat.jpg" ></item>
<item
name="Beauty"
icon="beauty.jpg" ></item>
<item
name="buggy"
icon="hibuggy.jpg" ></item>
<item
name="Issy"
icon="issy.jpg" ></item>
<item
name="file"
icon="file1.jpg" ></item>
Thanks my friends!