Flash, XML, and ActionScript

Status
Not open for further replies.

diabolo

Community Advocate
Community Support
Messages
1,682
Reaction score
32
Points
48
Code:
var xmlDoc:XML = new XML(); 
System.useCodepage = true; 
xmlDoc.ignoreWhite = true; 

xmlDoc.onLoad = function(ok:Boolean) { 
   if (ok) { 
       doMenu(this);        
   } else { 
       trace("XML did not load"); 
   } 
}; 

xmlDoc.load("myImages.xml"); 

function doMenu(xml:XML) { 
   var num:Number = xml.firstChild.childNodes.length;    
   pics = new Array();    
   for (var i = 0; i < num; i++) { 
       pics[i] = xml.firstChild.childNodes[i].attributes.image;        
   } 
   trace(pics);    
}
-the actionscript

Code:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?> 

<MENU> 
   <ITEM image="image1.jpg" /> 
   <ITEM image="image2.jpg" /> 
   <ITEM image="image3.jpg" /> 
   <ITEM image="image4.jpg" /> 
</MENU>
-the xml


can someone explain to me what the actionscript means?
 

taekwondokid42

New Member
Messages
268
Reaction score
0
Points
0
I'm not entirely sure, but it looks like when you activate certain portions of the code (the user side, not the server side) It will refer to the menu and pick out an appropriate image.

Note: I'm only answering this because its been a day and no one else has.
 
Status
Not open for further replies.
Top