# Simple question but i can't see it XML & flash

**URL:** https://forum.kirupa.com/t/simple-question-but-i-cant-see-it-xml-flash/175002
**Category:** Uncategorized
**Created:** [January 10, 2006, 11:31pm UTC](https://forum.kirupa.com/t/simple-question-but-i-cant-see-it-xml-flash/175002 "2006-01-10T23:31:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nitras](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nitras/32/1475_2.png) [@nitras](https://forum.kirupa.com/u/nitras)
#### Post date: [January 10, 2006, 11:31pm UTC](https://forum.kirupa.com/t/simple-question-but-i-cant-see-it-xml-flash/175002/1 "2006-01-10T23:31:54Z")

</div>

hi once more, another problem occured.  
why doesn’t this script work in flash 8

the buttons in the fla are resp. called btn0 , btn1 …to 4

but when i save to flash 8 as.2 it doesn’t do much. plz help thanx!

```auto
myxml = new XML();
myxml.ignoreWhite = true;
myxml.onload = parseMe;
myxml.load("tfile1.xml");
mainarray = [];
function parseMe(success) {
    if (success) {
        for (var k = 0; k<this.firstChild.childNodes.length; k++) {
            var pictures = this.firstChild.childNodes[k].childNodes;
            _root["array"+k] = [];
            for (var i = 0; i<pictures.length; i++) {
                var obj = {};
                for (var j in pictures*.attributes) {
                    obj[j] = pictures*.attributes[j];
                }
                _root["array"+k].push(obj);
            }
            mainarray.push(_root["array"+k]);
        }
    } else {
        "FAILED TO LOAD DATA";
    }
}

for (var i = 0; i<4; i++) {
    this["btn"+i].ivar = i;
    this["btn"+i].onPress = pressf;
}
delete i;
function pressf() {
    for (var obj in mainarray[this.ivar]) {
        trace (mainarray[this.ivar][obj].image+" "+mainarray[this.ivar][obj].caption);
    }
}

```
