Adding an image in AS3 via external XML

moody_4u

New Member
I think this is relatively simple, it just does not seem to be working for me. I think I am on the right track. This is what I have:\[code\]import mx.controls.Image; public var newImage:Image; public var myXML:XML; public var myLoader:URLLoader = new URLLoader(); public function init():void{ myLoader.load(new URLRequest("images.xml")); myLoader.addEventListener(Event.COMPLETE, processXML); } public function processXML(e:Event):void{ myXML = new XML(e.target.data); newImage = new Image(); newImage.source = myXML.IMAGE.@src; imgGroup.addElement(newImage); }\[/code\]It is not displaying the image for me though. Any ideas? Here is my XML for reference:\[code\]<?xml version="1.0" encoding="utf-8"?><GALLERY COLUMNS="5" XPOSITION="30" YPOSITION="30" WIDTH="100" HEIGHT="100"><IMAGE src="http://stackoverflow.com/questions/15687377/img_data/download.jpg" /></GALLERY>\[/code\]
 
Back
Top