I’m a little confused about formatting for functions. I have tried a couple things with the code below including putting it inside another function with no success.
I have an object that I am using for an XML array. I want to reaload the XML parsing using the new nameVariable, but the way this is set up I can’t seem to “functionize” the onLoad. What do I need to do to make this a function that can be called later on. I’m a little hazy with the whole object thing.
var text_obj:Object = new Object();
text_obj.xml = new XML();
text_obj.xml.ignoreWhite = true;
text_obj.xml.load("xml/" + nameVariable + "_copy.xml");
text_obj.xml.onLoad = function(success:Boolean):Void {
if (success) {
trace("Success");
parseXML();
} else {
trace ("error");
}
};