Jump to content
Search Community

vinchenzison

Members
  • Posts

    2
  • Joined

  • Last visited

vinchenzison's Achievements

0

Reputation

  1. Wow, Thank you for your detailed reply. I'll give that a go and restructure my xml document so LoaderMax can take advantage of it. Thanks again.
  2. Hi, New the forums and also LoaderMax but a big fan of TweenMax. I'm having a strange issue. I'm loading an xml file. //Load XML with LoaderMax var xmlLoader:XMLLoader = new XMLLoader("gallery.xml", {onComplete:xmlCompleteHandler}); //Start Loading XML xmlLoader.load(); And then the callback.. function xmlCompleteHandler(event:LoaderEvent):void { slides = []; var xml:XML = event.target.content; for (var i:int = 0; i < xml.image.length(); i++) { slides[i] = xml.image[i].@url; caps[i] = xml.image[i].@desc; } processImages(); } function processImages () { count = 0; for (var i:int = 0; i < slides.length; i++) { loaders[i] = new Loader(); loaders[i].load(new URLRequest(slides[i])); loaders[i].contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete); } } function onComplete(event:Event):void { var mc = event.target.content; mc.alpha = 0; var nmc:MovieClip = new MovieClip(); nmc.pos = count; nmc.cap = caps[count]; nmc.name = "nmc" + count; var nmcname = nmc.name; var porp = mc.width / mc.height; mc.width = stage.stageHeight * porp; mc.height = stage.stageHeight; nmc.addChild(mc); imageHolders[count] = new Array(); imageHolders[count][0] = nmc.width; imageHolders[count][1] = nmcname; this.mcholder.image_mc.addChild(nmc); count++; } Now my images are loading but are not displaying in the order that they are listed in the xml, and also the caption data isn't matching up with the correct image..! It appears to be random. I cannot see what's wrong here. My xml is like so.. <?xml version="1.0" encoding="UTF-8"?> Any pointers would be great. Thanks James
×
×
  • Create New...