# Can't Load XML in Scrollpane

**URL:** https://forum.kirupa.com/t/cant-load-xml-in-scrollpane/296774
**Category:** flash
**Created:** [September 20, 2009, 8:16am UTC](https://forum.kirupa.com/t/cant-load-xml-in-scrollpane/296774 "2009-09-20T08:16:12Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ph4zon](https://avatars.discourse-cdn.com/v4/letter/p/a9adbd/32.png) [@ph4zon](https://forum.kirupa.com/u/ph4zon)
#### Post date: [September 20, 2009, 8:16am UTC](https://forum.kirupa.com/t/cant-load-xml-in-scrollpane/296774/1 "2009-09-20T08:16:12Z")

</div>

Hey everyone, I’m using AS2 in Flash CS4. I have a web site that needs to show either Japanese or English text, depending on which option the user selects. My code works well, but when I try to load the text boxes into a scrollpane on the news page, the text doesn’t show. Is there any solution to this? I’m new to flash, so my code is very simple.

```auto
function loadXML(loaded) {
    if (loaded) {
        _root.head = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
        _root.stuff = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
        header1.text = _root.head;
        content1.text = _root.stuff;
        } else {
          trace("file not loaded!");
    }
    
    if (loaded) {
        _root.head = this.firstChild.childNodes[1].childNodes[0].firstChild.nodeValue;
        _root.stuff = this.firstChild.childNodes[1].childNodes[1].firstChild.nodeValue;
        header2.text = _root.head;
        content2.text = _root.stuff;
        } else {
          trace("file not loaded!");
    }
    
    if (loaded) {
        _root.head = this.firstChild.childNodes[2].childNodes[0].firstChild.nodeValue;
        _root.stuff = this.firstChild.childNodes[2].childNodes[1].firstChild.nodeValue;
        header3.text = _root.head;
        content3.text = _root.stuff;
        } else {
          trace("file not loaded!");
    }
    
    if (loaded) {
        _root.head = this.firstChild.childNodes[3].childNodes[0].firstChild.nodeValue;
        _root.stuff = this.firstChild.childNodes[3].childNodes[1].firstChild.nodeValue;
        header4.text = _root.head;
        content4.text = _root.stuff;
        } else {
          trace("file not loaded!");
    }
    
    
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
if (langVar == "en") {
    xmlData.load("news.xml");
} else if (langVar == "jp") {
    xmlData.load("JPnews.xml");
    
} else {
    xmlData.load("news.xml");
}

```

Any help is much appreciated. :hugegrin:
