PDA

View Full Version : how can i exchange a filename/url (like "XMLtoLoad") by a more general variable?



keitai
June 25th, 2003, 09:01 AM
Hi there,

I have the following question:

How can i load a dynamic xml, i.e. the .xml file that will be generated automatically and thus gets different names.

I want flash to "listen" to a variable "file", that is "file" represents the name of the xml-file to load. Like showXml.swf?file=abcd1234.xml

btw i don't exactly use the xml extension so it becomes showXml.swf?file=abcd1234

I using a general name = "XMLtoLoad" to load my xml.
My AS right now is somthing like:

file = XMLtoLoad;

_root.xmlDocument.load("XMLtoLoad");



In short how can i exchange a filename/url (like "XMLtoLoad") by a more general variable?

Or maybe i should ask how can i convert the name after "?file=" to a URL within AS

Grtz,
keitai

pom
June 25th, 2003, 10:38 AM
file = "XMLtoLoad";

_root.xmlDocument.load(file);?

keitai
June 25th, 2003, 11:13 AM
Let me try to explain myself better.



file = "XMLtoLoad";

_root.xmlDocument.load(file);



where file=abc1234 (see showXml.swf?file=abcd1234.xml) so in the end it must read



_root.xmlDocument.load("abcd1234.xml");



I personally think i must convert the value of file to a string/text. But i don't know how. I have tried



file = (abcd1234).toString();
trace (file);

But it doesn't work.

Any more suggestions?