First of all let me thank Senocular for his kick as* tutorial on xml and flash.
I don’t know if that one is brand new or if I just missed it until today.
i’m working on the second example .swf. the portfolio one. I’ve built a similar .fla from scratch and am basically taking his code apart piece by piece.
When I debug, I can tell that i’m getting the xml nodes in because i’m getting the multiple container mc’s for the menu.
for some reason I can get anything to appear in the menu_mc, the image_mc or any of my text boxes…
It’s gotta be something in my AS, the XML seems fine to me (maybe someone else will prove me wrong there though)…
anyhow, if anyone has figured it out (Senocular’s example) here’s my XML and AS:
AS:
var thumb_spacing = 55;
// load variables object to handle loading of text
var description_lv = new LoadVars();
description_lv.onData = function(raw_text){
description_txt.text = raw_text;
}
function GenerateGallery(gallery_xml){
var GalleryPictures = gallery_xml.firstChild.childNodes;
for (var i = 0; i < GalleryPictures.length; i++){
var currentPicture = GalleryPictures*;
var currentThumb_mc = menu_mc.createEmptyMovieClip("thumbnail_mc"+i,i);
currentThumb_mc._x = i * thumb_spacing;
currentThumb_mc.createEmptyMovieClip("thumb_container",0);
currentThumb_mc.thumb_container.loadMovie(currentPicture.attributes.thumb);
currentThumb_mc.title = currentPicture.attributes.title;
currentThumb_mc.image = currentPicture.attributes.image;
currentThumb_mc.description = currentPicture.attributes.description;
currentThumb_mc.onRollOver = currentThumb_mc.onDragOver = function(){
info_txt.text = this.title;
}
currentThumb_mc.onRollOut = currentThumb_mc.onDragOut = function(){
info_txt.text = "";
}
currentThumb_mc.onRelease = function(){
image_mc.loadMovie(this.image);
description_lv.load(this.description);
}
}
}
// xml object for xml content (defines sources for selections)
var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success){
if (success) GenerateGallery(this);
else trace("Error loading XML file"); // no success? trace error (wont be seen on web)
}
// load
gallery_xml.load("tiger.xml");
stop();
and here’s my xml:
<?xml version="1.0"?>
<gallery>
<picture title = "cave"
thumb = "images/thumbs/tcave.jpg"
description = "textfiles/cave.txt"
image = "images/lrgpics/cave.jpg" />
<picture title = "what's this guy holding anyway?"
thumb = "images/thumbs/tguyshands.jpg"
description = "textfiles/guyshands.txt"
image = "images/lrgpics/guyshands.jpg" />
<picture title = "crappy lake"
thumb = "images/thumbs/tlake.jpg"
description = "textfiles/lake.txt"
image = "images/lrgpics/lake.jpg" />
<picture title = "funky monks prepare to do battle."
thumb = "images/thumbs/tmonks.jpg"
description = "textfiles/monks.txt"
image = "images/lrgpics/monks.jpg" />
<picture title = "the monks' mountainside retreat"
thumb = "images/thumbs/tmountainside.jpg"
description = "textfiles/mountainside.txt"
image = "images/lrgpics/mountainside.jpg" />
<picture title = "buy two parrots, get one free!"
thumb = "images/thumbs/tparrots.jpg"
description = "textfiles/parrots.txt"
image = "images/lrgpics/parrots.jpg" />
<picture title = "we call it football in our country..."
thumb = "images/thumbs/tsoccer.jpg"
description = "textfiles/soccer.txt"
image = "images/lrgpics/soccer.jpg" />
<picture title = "shake your groove thing"
thumb = "images/thumbs/ttribal.jpg"
description = "textfiles/tribal.txt"
image = "images/lrgpics/tribal.jpg" />
</gallery>
any help would be great as I shamefully admit to being stuck!!!