This is part 3 of a Flash picture gallery tutorial
We created a XML code and now is loaded into Flash. Yet Flash sees it as text. We have 2 missions:
Enable our loaded file to be seen as XML code
Configure it in a way that we can use
For this task we will be creating a new type of variable: the XML list and this should enable us to work on our XML just like any array.
HERE IS THE SOURCE CODE!
// Avraham Saltoun
// solutions at say-web dot com
// FREE to USE, COPY and DISTRIBUTE
var xml:XML;
var xmlList:XMLList
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest (“data/XMLData.xml”));
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
function xmlLoaded (event:Event) {
xml =XML(event.target.data);
xmlList =xml.children();
trace (xmlList.length());
}






Mon, Mar 8, 2010
ActionScript