A lil flash/xml help!

Hey, im editing a template for a friend

http://www.goingoutnyc.com/test/

The events section is pulling information from an xml file…

<?xml version="1.0" ?>
<events year="2006">
<events name="Crazy Some**** Tuesdays" date="4/5/06" club="X.Bar" />
<events name="Caliente Thursdays" date="4/12/06" club="Tunnel" />
<events name="Some Listening Party" date="4/22/06" club="Club Black" />
</events>

What I want to do is some how link each event to an external JPEG that loads in a new browser window… so ill probably have to add some sort of flyer=“url” value to the tag, but im not sure how to go about implementing it in flash… please help i need to have this done by monday :frowning: thanks in advance :hitman: :glasses: :cool: :alien: :thumb2:

COuld be as simple as adding


<events name="Crazy Some**** Tuesdays" date="4/5/06" club="X.Bar" url="your.jpg"/>

But that does you or us no good, because we have no idea how the fla is set up :wink:

PopulateLists = function(xml_array){
name_txt.htmlText = date_txt.htmlText = club_txt.htmlText = “”;
for (var i=0; i<xml_array.length; i++){
var student = xml_array*.attributes;
name_txt.text += student.name + "
";
date_txt.text += student.date + "
";
club_txt.text += student.club + "
";
}
}
name_txt.html = true;
date_txt.html = true;
club_txt.html = true;
var students_array;
var grades_xml = new XML();
grades_xml.ignoreWhite = true;
grades_xml.html = true;
grades_xml.onLoad = function(success){
if (success){
var grades = this.firstChild;
students_array = grades.childNodes;
PopulateLists(students_array);
}else trace(“Error loading XML file.”);
}
grades_xml.load(“events.xml”);

Sorry :slight_smile: thats the as…

anybody? :ub:

Hey! I ended up figuring it out…

menu = new XML();
menu.ignoreWhite = true;
menu.load("events.xml");
menu.onLoad = function() {
	items = this.firstChild.childNodes;
	for (i=0; i&lt;=items.length-1; i++) {
		_root.attachMovie("eventbuttons", "item"+i, i);
		_root["item"+i].nametxt.text = items*.attributes.name;
		_root["item"+i].datetxt.text = items*.attributes.date;
		_root["item"+i].clubtxt.text = items*.attributes.club;
		_root["item"+i].categorytxt.text = items*.attributes.category;
		_root["item"+i]._y = 25*i;
		_root["item"+i]._y += 245.5;
		_root["item"+i]._x = 515.5;
		_root["item"+i].itemUrl = items*.attributes.theurl;
		_root["item"+i].onRelease = function() {
			getURL(this.itemUrl, "_blank");
		};
	}
	// end of for
};

Hey! I ended up figuring it out…

menu = new XML();
menu.ignoreWhite = true;
menu.load("events.xml");
menu.onLoad = function() {
	items = this.firstChild.childNodes;
	for (i=0; i<=items.length-1; i++) {
		_root.attachMovie("eventbuttons", "item"+i, i);
		_root["item"+i].nametxt.text = items*.attributes.name;
		_root["item"+i].datetxt.text = items*.attributes.date;
		_root["item"+i].clubtxt.text = items*.attributes.club;
		_root["item"+i].categorytxt.text = items*.attributes.category;
		_root["item"+i]._y = 25*i;
		_root["item"+i]._y += 245.5;
		_root["item"+i]._x = 515.5;
		_root["item"+i].itemUrl = items*.attributes.theurl;
		_root["item"+i].onRelease = function() {
			getURL(this.itemUrl, "_blank");
		};
	}
	// end of for
};

Small problem though… how do I get that code to load the menu into an empty movie clip, called…lets say “empty_mc” instead of right on the main timeline?

menu = new XML();
menu.ignoreWhite = true;
menu.load("events.xml");
menu.onLoad = function() {
	items = this.firstChild.childNodes;
	for (i=0; i<=items.length-1; i++) {
		var empty_mc = _root.createEmptyMovieClip("empty_mc", 1);
		//position empty_mc
		empty_mc._x = empty_mc._y=50;
		var item = empty_mc.attachMovie("eventbuttons", "item"+i, i);
		item.nametxt.text = items*.attributes.name;
		item.datetxt.text = items*.attributes.date;
		item.clubtxt.text = items*.attributes.club;
		item.categorytxt.text = items*.attributes.category;
		item._y = 245.5+25*i;
		item._x = 515.5;
		item.itemUrl = items*.attributes.theurl;
		item.onRelease = function() {
			getURL(this.itemUrl, "_blank");
		};
	}
};

scotty(-: