# Duplicate Movie Clips & XML

**URL:** https://forum.kirupa.com/t/duplicate-movie-clips-xml/149204
**Category:** Uncategorized
**Created:** [May 26, 2005, 8:56pm UTC](https://forum.kirupa.com/t/duplicate-movie-clips-xml/149204 "2005-05-26T20:56:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![plantain\_tart](https://avatars.discourse-cdn.com/v4/letter/p/7ea924/32.png) [@plantain\_tart](https://forum.kirupa.com/u/plantain_tart)
#### Post date: [May 26, 2005, 8:56pm UTC](https://forum.kirupa.com/t/duplicate-movie-clips-xml/149204/1 "2005-05-26T20:56:14Z")

</div>

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.

```auto

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.

```auto

<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!
