# Setting a loadmovie swf name dynamically from a txt file

**URL:** <https://forum.kirupa.com/t/setting-a-loadmovie-swf-name-dynamically-from-a-txt-file/121277>\
**Category:** Uncategorized\
**Created:** [September 1, 2004, 4:57pm UTC](https://forum.kirupa.com/t/setting-a-loadmovie-swf-name-dynamically-from-a-txt-file/121277 "2004-09-01T16:57:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rynokins](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@rynokins](https://forum.kirupa.com/u/rynokins)\
**Post date:** [September 1, 2004, 4:57pm UTC](https://forum.kirupa.com/t/setting-a-loadmovie-swf-name-dynamically-from-a-txt-file/121277/1 "2004-09-01T16:57:33Z")

</div>

As the title of this post says, I’m trying to have the swf name in the loadmovie line to be generated from a txt file…

The text file (named “swfvariable.txt”) goes as such:

```auto
variable=swfpick

```

And the script goes like this:

```auto
loadVarsText = new loadVars();
loadVarsText.load("swfvariable.txt");
name = this.variable;
picked = ("load_"+name+".swf");
loadMovie(picked, "_root.target");

```

When I create a dynamic text field with the var name “name” - the variable “swfpick” shows up in it. But no matter what, so far, all I’m getting is the movie trying to load in “load\_.swf”

Any ideas?
