views:

2540

answers:

3

Hi,

Can someone tell me how i can change the .xml file that a flash movie loads using c#. ie: i would like an ActionScript variable that defines the location of the flash movie. I would like to be able to change this variable using c# if possible.

i dont really know how it would look, but something like:

<object xmlpath='" + myCSharpVar + "'" ...></object>

I just starting this, but my ultimate goal is to create a .swf movie that can load an xml file that specifies images, etc. However i want to use the same .swf file in multiple places and only have to change a ref to what xml file it uses - and my Flash/ActionScript skills are very rusty.

To clear it up a bit, in AS you can do something like:

loader.load( new URLRequest("IWantThisNameDynamic.xml") );

how can i define that xml file in my c# code?

+1  A: 
Argelbargel
LOL - that was just for demo purposes - im sure it would have been much clearer if i did it in the param, but i honestly didnt know where it went. Thanks for the reply, i still may ask w3c and tell them its for a special project - ha ha --- thanks again.
schmoopy
A: 

Edit: sorry, question was about ASP.NET

If you were using an AxShockwaveFlash object in C#, you would set the variables this way:

AxShockwaveFlash movie; // already exists
string xmlPath = "some path";
movie.FlashVars = "xmlPath=" + xmlPath; // url-encoded variables

Then in AS2:

var xmlPath:String = _level0.xmlPath;

Or in AS3:

var xmlPath:String = loaderInfo.parameters.xmlPath;
Philippe
A: 

Also look into the ExternalInterface class that Adobe has introduced. It has the ability to communicate to external javascript and handle return events.

eric