Create a Complete Flash XML Gallery Tutorial – Actionscript 3.0
In this video we will create a complete, yet simple XML gallery. This tutorial is somewhere between Interemediate and Advanced level so if you know a little bit about actionscript you should be just fine, but if you are adventurous you should be able be fine no matter your skill level. We will create nice click-through gallery using XML and actionscript 3.0.
love it! but how do i add titles?
There can’t be much intuitive tutorial than this one! This is the way to go about AS3! Thank your for this tutorial! I just loved it!
1M Thanks. Your explanations are very simple to understand. What’s Next? 😉
Hi. I’ve folowed the instructions to the letter. Exact same structure – image numbering, images, xml file &swf in the same folder. The first trace event shows the xml file contents as shown in the tutorial. I get to line 17 and Control Test Movie throws the following error:
Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
Any ideas anyone?
Here’s the code:
var xmlRequest:URLRequest = new URLRequest(“imageDataFood.xml”);
var xmlLoader:URLLoader = new URLLoader(xmlRequest);
var imgData:XML;
var imageLoader:Loader;
var rawImage:String;
var imgNum:Number = 0;
xmlLoader.addEventListener(Event.COMPLETE, xmlLoadedF);
function xmlLoadedF(event:Event):void{
imgData = new XML(event.target.data);
rawImage = imgData.image[imgNum].imgURL;
imageLoader = new Loader;
imageLoader.load(new URLRequest(rawImage));
master_mc.addChild(imageLoader);
}
Hi,I nave a problem with the positioning. It gives me this error
Scene 1, Layer ‘as3’, Frame 1, Line 33 1195: Attempted access of inaccessible method x through a reference with static type flash.display:Loader.
on those two lines :
imageLoader.x(stage.stageWidth-Number(rawW))/2;
imageLoader.y(stage.stageHeight-Number(rawH))/2;