Hi, I’ve a problem loading data from xml into a class of mine. I put the code:
Frame on Flash:
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).