views:

54

answers:

2

Hay, i have a flash movie which loads a static XML file, the script for this looks like

list = "list.xml";
var listXml:XML = new XML();
listXml.ignoreWhite = true;
listXml.load(list);

I want to be able to change this 'list' variable dynamically, perhaps using flashVars.

like this

 var flashvars = {
    xmlpath: "list.xml"
};

Any idea's how to go about doing this?

A: 

The flashvars properties are accessible in the parameters property of the LoaderInfo object.

In your main class:

var info:Object = this.loader.contentLoaderInfo.parameters;
var xmlpath:String = info.xmlpath;

Check this article: http://blogs.adobe.com/pdehaan/2006/07/using_flashvars_with_actionscr.html

PatrickS
+1  A: 

http://www.actionscript.org/forums/showthread.php3?t=185370

http://stackoverflow.com/questions/2302722/as3-pass-flashvars-to-loaded-swf

if you have some code already, please share, so we could advice you

Eugene