Why hello again.
PROBLEM
trying to load five images from an xml array randomly without replacement*
*without replacment - meaning i dont want to use the same random number in my array.
all i need is the math for the actionscript
menuXml = new XML();
menuXml.ignoreWhite = true;
menuXml.onLoad = function() {
menuItem = menuXml.firstChild.childNodes;
for (var i=0; i<5; i++) {
trace(count = menuItem.length);
num = Math.floor(Math.random()*count);
item = _root.attachMovie("itemClip", "itemClip" + i, i);
item._x = _root.test._x + (50*i);
item._y = _root.test._y;
item.itemLabel.loadMovie(menuItem[num].attributes.src);
item.myUrl = menuItem[num].attributes.url;
item.onRelease = function() {
getURL(this.myUrl,"_blank");
}
};
}
menuXml.load("myMenu.xml");
And here is my xml file:
<?xml version="1.0"?>
<mymenu>
<myitem url="[http://www.good-tutorials.com/track/3067" src="[url="http://www.good-tutorials.com/images/icons/3067.jpg"]http://www.good-tutorials.com/images/icons/3067.jpg](http://www.good-tutorials.com/track/3067)" />
<myitem url="[http://www.good-tutorials.com/track/3198" src="[url="http://www.good-tutorials.com/images/icons/3198.jpg"]http://www.good-tutorials.com/images/icons/3198.jpg](http://www.good-tutorials.com/track/3198)" />
<myitem url="[http://www.good-tutorials.com/track/3357" src="[url="http://www.good-tutorials.com/images/icons/3357.jpg"]http://www.good-tutorials.com/images/icons/3357.jpg](http://www.good-tutorials.com/track/3357)" />
<myitem url="[http://www.good-tutorials.com/track/3366" src="[url="http://www.good-tutorials.com/images/icons/3366.jpg"]http://www.good-tutorials.com/images/icons/3366.jpg](http://www.good-tutorials.com/track/3366)" />
<myitem url="[http://www.good-tutorials.com/track/3376" src="[url="http://cgi.akulesworld.com/images/tuts/metalplate/icon.jpg"]http://cgi.akulesworld.com/images/tuts/metalplate/icon.jpg](http://www.good-tutorials.com/track/3376)" />
<myitem url="[http://www.good-tutorials.com/track/3385" src="[url="http://cgi.akulesworld.com/images/tuts/flowingwaves/icon.jpg"]http://cgi.akulesworld.com/images/tuts/flowingwaves/icon.jpg](http://www.good-tutorials.com/track/3385)" />
<myitem url="[http://www.good-tutorials.com/track/3409" src="[url="http://www.good-tutorials.com/images/icons/3409.jpg"]http://www.good-tutorials.com/images/icons/3409.jpg](http://www.good-tutorials.com/track/3409)" />
<myitem url="[http://www.good-tutorials.com/track/3162" src="[url="http://www.good-tutorials.com/images/icons/3162.jpg"]http://www.good-tutorials.com/images/icons/3162.jpg](http://www.good-tutorials.com/track/3162)" />
</mymenu>
can someone help me figure out this without replacement crap??