...

View Full Version : Load XML



sweetz
03-04-2009, 12:36 AM
Hi,

How can I load xml into my file using flashvars?

// LOAD XML
//
loadXML = function (loaded) {
if (loaded) {
xmlNode = this.firstChild;
total = xmlNode.childNodes.length;
Thumb = [];
VideoClip = [];
Title = [];
Copy = [];
// Build category menu
menu_all.header_mc.headerName.text = xmlNode.attributes.Name;
for (n=0; n<total; n++) {
menu_all.menu_mc.duplicateMovieClip("menu_mc"+n, n);
menu_all["menu_mc"+n]._x = menu_all.header_mc._width+(menu_all.menu_mc._width)*n;
menu_all["menu_mc"+n].txt_mc.categoryName.text = xmlNode.childNodes[n].attributes.Name;
menu_all["menu_mc"+n].ID = n;
alignObjects();
}
nav_mc._visible = true;
menu_all._visible = true;
menu_all.menu_mc._visible = false;
buildGallery()
} else {
trace("Error loading XML");
}
};
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("music.xml");
stop();



I tried this, and it doesn't work for me.

xmlData.load (this.myFile);

Thanks in advance.

gnomeontherun
03-04-2009, 11:29 AM
flashvars is just a variable that you can set in HTML that is available in flash. Look at my signature for a post about embedding flash where you can send that variable, and then just use the variable name inside of flash.

A good XML tutorial in Flash

http://www.kirupa.com/web/xml/index.htm



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum