# Url for txt file in dynamic text field?

**URL:** <https://forum.kirupa.com/t/url-for-txt-file-in-dynamic-text-field/322800>\
**Category:** flash\
**Created:** [June 3, 2011, 3:23pm UTC](https://forum.kirupa.com/t/url-for-txt-file-in-dynamic-text-field/322800 "2011-06-03T15:23:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![matej](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@matej](https://forum.kirupa.com/u/matej)\
**Post date:** [June 3, 2011, 3:23pm UTC](https://forum.kirupa.com/t/url-for-txt-file-in-dynamic-text-field/322800/1 "2011-06-03T15:23:56Z")

</div>

Hi, I have a problem with a dynamic text field, which displays a txt file.

If I hardcode the file name in the code, then it works fine. This is on the first frame of my movie, which holds the dynamic text field.

```auto
myData = new LoadVars();
myData.onLoad = function(success)
{
	if (success)
	{
		mytxt.htmlText = this.txt;
	}
};

myData.load("test.txt);

stop();

```

But if I try to define the url of the text with a variable, and try to send it the url in the browser (.swf?txturl=http://www.myurl.com/), it doesn’t work:

```auto
myData = new LoadVars();
myData.onLoad = function(success)
{
	if (success)
	{
		mytxt.htmlText = this.txt;
	}
};

link = _root.txturl + "test.txt";

myData.load(link);

stop();

```

Is there a trick to defining url’s for dynamic text fields? Because if I hardcode the path from the server, it works locally, but again not on the server…

Could it be a problem of permisson (since the url of the txt is from a different page than the one the swf is on)?

Any ideas? Thanks!
