//XMLController
//Comment: Include XML Controller for language translation functionality.
//Developer: Ryan Roberts
//Date: 9-5-2006
public function ParseXML(xmlFile:String){
//"E:/Inetpub/Nutrilite_Frontsite/en-us/Support/ntLanguages.xml"
trace("ParseXML XML FILE:" + xmlFile);
var strMenuHTML = "";
var xmlDSReturn:Array = new Array;
var strXPath:String = "/Languages/Language[@Type]";
var intCnt:Number = 0;
var xmlDataSource:XML = new XML();
xmlDataSource.ignoreWhite = true;
xmlDataSource.load(xmlFile);
xmlDataSource.onLoad = function(){
xmlDSReturn = mx.xpath.XPathAPI.selectNodeList(xmlDataSource.firstChild, strXPath);
for (intCnt = 0; intCnt < xmlDSReturn.length; intCnt++) {
strMenuHTML = strMenuHTML + "<a href=\"" + xmlDSReturn[intCnt].attributes["RelativeURL"].toString() + xmlDSReturn[intCnt].attributes["Abbreviation"].toString() + "/default.aspx" + "\">" + xmlDSReturn[intCnt].attributes["Type"].toString() + "</a><br/>"
}
return strMenuHTML;
}
}
When I call this function which lies in a class attached to a movie clip I pass the required arguments and the function fires and i can trace the results, but how do use the return strMenuHTML inside the movie clip which this attached to?
this.ParseXML(“E:/Inetpub/Nutrilite_Frontsite/en-us/Support/ntLanguages.xml”);
If the variable is declared as a string, or lets say i built an array will it return that way?
Thankyou much!
-Ry