Parsing variables from a xml file

I’m trying to pull a variable from a xml file and then going to a frame based on that variable. The online image is at 3 and the offline is at 2. I have a stop action on all the frames as well. It keeps getting stuck on frame 2 tho even tho my status.xml says status=online

Any help would be very appreciated.

stop();
myXML = new XML();
// onload
myXML.onLoad = function (success) {
if (success) {
// put entire txt into variable
theTxt = this.firstChild;
// you can then call a function to parse it
}
}
// load txt
myXML.load(“status.xml”);

if(theTxt == “online” ){
gotoAndPlay(3);
} else {
gotoAndPlay(2);
}