# \[Flash 8\] XML onLoad problem

**URL:** <https://forum.kirupa.com/t/flash-8-xml-onload-problem/226988>\
**Category:** flash\
**Created:** [May 25, 2007, 5:11pm UTC](https://forum.kirupa.com/t/flash-8-xml-onload-problem/226988 "2007-05-25T17:11:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![batuz](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@batuz](https://forum.kirupa.com/u/batuz)\
**Post date:** [May 25, 2007, 5:11pm UTC](https://forum.kirupa.com/t/flash-8-xml-onload-problem/226988/1 "2007-05-25T17:11:09Z")

</div>

Hi, I’ve a problem loading data from xml into a class of mine. I put the code:

Frame on Flash:

```auto

vlist = new VideoList();

var vxml = new XML();
vxml.ignoreWhite = true;
vxml.onLoad = function(loaded) {
    if(loaded)
    {
        var mat = new Array();
        var ti,th,pa;
        var len = this.firstChild.childNodes.length;
        for(var i=0;i<len;++i)
        {
            ti = this.firstChild.childNodes*.childNodes[0].firstChild;
            th = this.firstChild.childNodes*.childNodes[1].firstChild;
            pa = this.firstChild.childNodes*.childNodes[2].firstChild;
            vlist.addVideoClip(new VideoClip(ti,th,pa));
        }
    }
}

vxml.load("videos.xml");
trace(vlist.getFirst()); // Here there is no data

```

VideoList is a container class of VideoClip type, both writed on my own.

VideoList just uses an array to hold VideoClip objects.

I think the problem maybe is either how I reference to vlist variable or  
when I try to read the data it’s not available yet.

I’m a beginner (really two days experience). 😛
