5Parsing XML with AS2
Accessing XML Nodes: The Script
In this chapter we deal with parsing XML data. We use one script for all examples, which will always have the same structure. We import the class InitiateXml to load the XML file. Then we declare the class and the variable “iniXml”, which is the instance variable holding the XML data. The data is parsed in the function “loadXML”. Only the code within the “loadXML” function will be shown, since apart from the class name everything else will stay the same.
import scripts.helper.InitiateXml;
class scripts.Attributes
{
public var iniXml:InitiateXml;
public function Attributes ()
{
}
public function test (myFile:String, proxy:Boolean)
{
iniXml = new InitiateXml (); iniXml.init (myFile, ...
Get Flash XML Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.