Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-03-2009, 11:36 PM   PM User | #1
sweetz
New to the CF scene

 
Join Date: Mar 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
sweetz is an unknown quantity at this point
Load XML

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.
sweetz is offline   Reply With Quote
Old 03-04-2009, 10:29 AM   PM User | #2
gnomeontherun
Senior Coder

 
gnomeontherun's Avatar
 
Join Date: Sep 2007
Location: Houston
Posts: 2,846
Thanks: 10
Thanked 238 Times in 229 Posts
gnomeontherun will become famous soon enoughgnomeontherun will become famous soon enough
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
__________________
jeremy - gnomeontherun
Educated questions often get educated answers, and simple questions often get simple answers.
gnomeontherun is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:28 PM.


Advertisement
Log in to turn off these ads.