Why doesn’t this work?
AS
var picturesXML:XML = new XML();
picturesXML.ignoreWhite = true;
picturesXML.onLoad = function(ok) {
if(ok) {
var back:Array = picturesXML.firstChild.childNodes;
for (var i = 0; i<back.length; i++) {
imgURL = back*.attributes.source;
//trace(images*);
//trace(imgURL);
this.loadMovie(imgURL);
}
} else {
//error
}
};
picturesXML.load("data.xml");
xml
<?xml version="1.0" encoding="iso-8859-1"?>
<background>
<back source="back1.jpg"/>
</background>
matt
Jpao17
April 11, 2006, 4:36pm
2
mattiej:
Why doesn’t this work?
AS
var picturesXML:XML = new XML();
picturesXML.ignoreWhite = true;
picturesXML.onLoad = function(ok) {
if(ok) {
var back:Array = picturesXML.firstChild.childNodes;
for (var i = 0; i<back.length; i++) {
imgURL = back*.attributes.source;
//trace(images*);
//trace(imgURL);
this.loadMovie(imgURL);
}
} else {
//error
}
};
picturesXML.load("data.xml");
xml
<?xml version="1.0" encoding="iso-8859-1"?>
<background>
<back source="back1.jpg"/>
</background>
matt
Replace this.loadMovie(imgURL);
with _root.loadMovie(imgURL);
In your case, this is referring to the XML. if you were to trace(this); it would return the XML. trace(_root); gives you _level0 which is what your looking for.
-Chris
Thank for your replay!
I will try this next week, hehe so takes a while for me to test it
matt