I need to load a set of images with from XML and assign Interactivity to them
first I load the XML
import flash.display.Loader;
import flash.net.URLRequest;
var loader:Loader = new URLLoader();
var request:URLRequest = new URLRequest("myXML.xml");
loader.load(request);
loader.addEventListener(Event.Complete, proessFile);
function processFile(e:Event):void
{
var loadedXML:XML = (e.target.data);
}
//load set of images from XML file
for (var i:uint = 0; i < loadedXML.image.length(); i++)
{
var imgLoader:Loader = new Loader();
var imgRequest:URLRequest = new URLRequest (loadedXML.img[i].attribute("filepath"));
imgLoader.load(imgRequest);
addChild(imgLoader);
}
here I need to make every single image draggable. Is it possible to change it into another data type, b/c I can't work with Loader?
I've tried assign them .name property, but I was unable to call them later.
I don't know If I'm clear enough, but essentially I need to work with every single loaded image as new object. Is it possible to assign variable to every single image?
Any suggestion for thework flow here would be much appreciated.