/ Published in: ActionScript 3
Expand |
Embed | Plain Text
var photoXML:XML = new XML(); var xmlLoader:URLLoader = new URLLoader(); xmlLoader.load(new URLRequest('xml/photos.xml')); xmlLoader.addEventListener(Event.COMPLETE, processXML); function processXML(e:Event):void { photoXML = new XML(e.target.data); trace(photoXML.image)// trace all image nodes trace(photoXML.image.@width)// trace attribute of width } /* XML SHOULD LOOK LIKE THIS <?xml version="1.0" encoding="utf-8"?> <gallery> <image width="500">http://1984interactive.com/photography/misc/IMG_0383.jpg</image> <image width="300">http://1984interactive.com/photography/misc/IMG_0383.jpg</image> <image width="100">http://1984interactive.com/photography/misc/IMG_0383.jpg</image> </gallery> */
Comments
Subscribe to comments
You need to login to post a comment.

Si subieras todo el código incluyendo los import sería sumamente util :)