# Parsing variables from a xml file

**URL:** <https://forum.kirupa.com/t/parsing-variables-from-a-xml-file/246474>\
**Category:** Uncategorized\
**Created:** [December 11, 2007, 2:38pm UTC](https://forum.kirupa.com/t/parsing-variables-from-a-xml-file/246474 "2007-12-11T14:38:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashninja](https://avatars.discourse-cdn.com/v4/letter/f/b5ac83/32.png) [@flashninja](https://forum.kirupa.com/u/flashninja)\
**Post date:** [December 11, 2007, 2:38pm UTC](https://forum.kirupa.com/t/parsing-variables-from-a-xml-file/246474/1 "2007-12-11T14:38:29Z")

</div>

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);  
}
