Im trying to set up a class which will load xml and return data I can later parse with a parser class.
When I run the getRawData function from the fla, I get [type function]. any ideas?
class XMLloader {
public var rawData:String;
public var setTimeout:Function;
private var _filePath:String;
private var myXML:XML;
function XMLloader(filePath:String) {
this._filePath = filePath;
this.myXML = new XML();
init();
}
private function init() {
myXML.ignoreWhite = true;
myXML.onLoad = function() {
rawData = this;
};
myXML.load(_filePath);
}
public function getRawData(){
return rawData;
}
private function toString():String{
return ("[XMLloader]")
}
}
from the fla
import XMLloader
var myXML:XMLloader = new XMLloader("test.xml");
trace(myXML.getRawData)