I have created a class in action script 2.0 which is as follows.
class ActionScripts.EllipseXML
{
var externalXML:XML;
var Options:Array = new Array(4);
public function EllipseXML()
{
externalXML = new XML();
externalXML.ignoreWhite = true;
externalXML.load("decryptedfile.xml");
//thisXML.onLoad = LoadNextQuoestion; //LoadExamData;
externalXML.onLoad = LoadExamData;
stop();
}
function LoadExamData()
{
var BaseNode = externalXML.childNodes[0];
trace("Load Called");
Options.push(BaseNode.firstChild.childNodes[1].firstChild.nodeValue);
Options.push(BaseNode.firstChild.childNodes[2].firstChild.nodeValue);
Options.push( BaseNode.firstChild.childNodes[3].firstChild.nodeValue);
Options.push(BaseNode.firstChild.childNodes[4].firstChild.nodeValue);
Options.push(BaseNode.firstChild.childNodes[5].firstChild.nodeValue);
}
public function GetOptions():Array
{
return Options;
}
}
I want to load the XML and use this class methods in fla in action script the problem here is I am not able to load the XML. thus will you please guid me in doing so?
Hello,
I am attiching example how to parse xml in as2 please find the attachment and let me know if you have any query
Regards,
Kunjan.