Displaying random images
I want to display let's say 3 random images out out of 6 images. Every time I click a button, I should be having a display of 3 unique random images.
All I know, and understand is the following. My XML file has 6 images. I know that I need the shuffle function to get to the desired result, but I don't know How.
The script below, will only trace all of them or one of them, that's it. It is the math part that I don't comprehend much. I thought I'll give it another shot, before I decide taking up another hobby,................ like playing soccer with my crazy rottweiller.
Sam
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("jamilou.xml"));
myLoader.addEventListener(Event.COMPLETE, processXML);
function processXML(e:Event):void
{
myXML = new XML(e.target.data);
trace(myXML.IMAGE.*);
}
