Okay, I’ve read through the XML and Image loading threads and none of them seem to adapt to what I’m trying to do. Basically my question is this:
“I know how to load text dynamically into Flash, but how do I load an image from the same XML file as the text into a blank movieclip that is sitting on the stage?”
Can someone explain the variable setup, XML parsing, and the XML code to me…this has had me strangling myself with my cordless keyboard and mouse for hours.
my current AS is as follows (with functional loading text…I get an “error loading URL” message for the image):
function loadXML(loaded) {
if (loaded) {
_root.interview = this.firstChild.childNodes[0].firstChild.nodeValue;
_root.review = this.firstChild.childNodes[1].firstChild.nodeValue;
_root.shows = this.firstChild.childNodes[2].firstChild.nodeValue;
_root.media = this.firstChild.childNodes[3].firstChild.nodeValue;
_root.band = this.firstChild.childNodes[4].firstChild.nodeValue;
interview.text = _root.interview;
review.text = _root.review;
shows.text = _root.shows;
media.text = _root.media;
band_mc.loadMovie(_root.band,1);
} else {
trace("error loading content");
}
}
xmlContent = new XML();
xmlContent.ignoreWhite = true;
xmlContent.onLoad = loadXML;
xmlContent.load("cover.xml");
cover.xml looks like this:
<?xml version="1.0" encoding="iso-8859-1"?>
<cover>
<interview>MVM sits down with Artist's Name</interview>
<review>Name of Album or [EP]</review>
<shows>Find out who's playing where</shows>
<media>Photos + Exclusive Audio & Video</media>
<band>band.jpg</band>
</cover>
I’ve tried
<band>band.jpg</band>
with double " and ’
An explanation of my error and the proper way to do this from a single XML file would be greatly appreciated.
Damien