However, I've hit a deadend with some problems. I have succeeded parsing the XML data in Flash, however, the width of the values are not being parsed correctly.
Here is the code:
depth = 0;
var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success) {
if (success) {
var gallery = this.firstChild;
item_array = gallery.childNodes;
loadImage();
}
};
gallery_xml.load("gallery.xml");
function loadImage() {
attachMovie("mcImage", "image_mc", 5);
tempMc = image_mc;
tempMc.bg_mc.fwidth = item_array[depth].childNodes[3].childNodes[0];
tempMc.bg_mc.onEnterFrame = function() {
this._width += 5;
if(this._width>this.fwidth) {
delete this.onEnterFrame
}
};
tempMc._x = Stage.width/2;
tempMc._y = Stage.height/2;
tempMc.empty_mc.createEmptyMovieClip("holder_mc", 10);
tempMc.empty_mc.holder_mc.loadMovie("data/thumbs/"+item_array[depth].childNodes[2].childNodes[0]);
tempMc.bg_mc._height = item_array[depth].childNodes[4].childNodes[0]+20;
}
The problem here, is that fwidth is not recognized as a number. Doing a trace commands returns that fwidth is a number, which was parsed from XML. However, flash is not recognizing it in this particular part:
if(this._width>this.fwidth) {
delete this.onEnterFrame
}
Here is the XML File also:
<?xml version="1.0" encoding="iso-8859-1"?> <gallery> <item> <title>Work 1</title> <date>date 1</date> <location>thumb1.jpg</location> <width>150</width> <height>100</height> </item> </gallery>
Hope someone can help me out! Thanks!
