# How can i exchange a filename/url (like "XMLtoLoad") by a more general variable?

**URL:** <https://forum.kirupa.com/t/how-can-i-exchange-a-filename-url-like-xmltoload-by-a-more-general-variable/24027>\
**Category:** Uncategorized\
**Created:** [June 25, 2003, 1:01pm UTC](https://forum.kirupa.com/t/how-can-i-exchange-a-filename-url-like-xmltoload-by-a-more-general-variable/24027 "2003-06-25T13:01:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![keitai](https://avatars.discourse-cdn.com/v4/letter/k/73ab20/32.png) [@keitai](https://forum.kirupa.com/u/keitai)\
**Post date:** [June 25, 2003, 1:01pm UTC](https://forum.kirupa.com/t/how-can-i-exchange-a-filename-url-like-xmltoload-by-a-more-general-variable/24027/1 "2003-06-25T13:01:55Z")

</div>

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:  
[AS]  
file = XMLtoLoad;

\_root.xmlDocument.load(“XMLtoLoad”);

[/AS]

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 25, 2003, 2:38pm UTC](https://forum.kirupa.com/t/how-can-i-exchange-a-filename-url-like-xmltoload-by-a-more-general-variable/24027/2 "2003-06-25T14:38:37Z")

</div>

[AS]file = “XMLtoLoad”;

\_root.xmlDocument.load(file);[/AS]?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 25, 2003, 3:13pm UTC](https://forum.kirupa.com/t/how-can-i-exchange-a-filename-url-like-xmltoload-by-a-more-general-variable/24027/3 "2003-06-25T15:13:12Z")

</div>

Let me try to explain myself better.

```auto

file = "XMLtoLoad";

_root.xmlDocument.load(file);

```

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

```auto

_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

```auto

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

```

But it doesn’t work.

Any more suggestions?
