Senocular's XML tutorial

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!!!

arrrggghhh…

i’ve been going over the AS and XML the better part of a day…

still nothing… the flash is reading the xml and creating the empty movie clips but nothing displays!!!

@#$@$%@#^$^!!!

Post your .fla?

scotty(-:

hello,

here’s the basic .fla, no frills…

one thing i’ve discovered is that if I try to get Senocular’s .fla to load my images it doesn’t work… they’re just jpegs and they’re smaller than the ones he uses in his example… they’re pathed correctly in my .xml file.

i also tried using my xml in his .fla instead of his and again, nothing works…

my .xml is almost identical to his in node structure, i just have a few more child nodes…

thanks if you decide to take a look…

I’ll have a look, but for the pictures, be sure they’re non-progressive jpeg’s…:wink:

scotty(-:

they are not progressive jpegs… appreciate it…

can’t upload the pics/folder heirarchy cuz too large (100k zipped) sorry…

Weird, it works for me…
I get the thumbs, title text and the big pics.
I didn’t make text-files for the description, but that should work as well.
Can’t you upload your zip somewhere?

scotty(-:

hmm that is very strange… are you using mx or 2004? Mac or Pc?

if you pm me your email i could attach the file and send it to you…

thanks for looking at it at any rate…

Check your PM;)

scotty(-: