# Load Var

**URL:** <https://forum.kirupa.com/t/load-var/244389>\
**Category:** flash\
**Created:** [November 17, 2007, 5:55am UTC](https://forum.kirupa.com/t/load-var/244389 "2007-11-17T05:55:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![creyentededios](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@creyentededios](https://forum.kirupa.com/u/creyentededios)\
**Post date:** [November 17, 2007, 5:55am UTC](https://forum.kirupa.com/t/load-var/244389/1 "2007-11-17T05:55:25Z")

</div>

Heres what i would like to do

i have a small flash file with a dynamic text field with instance name: load\_txt

i have a server…[http://myserver.com](http://myserver.com)

what i would like to be able to do is when embedding my flash file with the empty text field, put a “?” after the .swf and then put something like “url”

with that, in the actionscript i would have it set to go to:  
[http://myserver.com/“url”.txt](http://myserver.com/%22url%22.txt)

so if i did

[myserver.com/test.swf?url=ben](http://myserver.com/test.swf?url=ben)

the flash file would load, and whatever would be in:  
[http://myserver.com/ben.txt](http://myserver.com/ben.txt)  
would load into the text field in the flash

i would already have the url labeled, just need to place the name of the txt file in the .swf? and then it would load properly

im sure it would be easy to do…  
i have this code:

```auto
var man_laws:LoadVars = new LoadVars();
man_laws.onData = function(src:String):Void {
    if (src != undefined) {
        my_txt.text = src;
    } else {
        man_laws.load("http://manlaws.tripod.com/manlaw.txt");;
    }
};
if(_root.url== undefined){
_root.url = "http://manlaws.tripod.com/manlaw.txt";
}

man_laws.load(_root.url);

```

as you can see…i could do this:  
test.swf?url=http://manlaws.tripod.com/manlaw.txt

whatever was in that text file would load into the flash

what i want to do is be able to say  
test.swf?url=manlaw  
and have the link already defined  
so it would load the file “[http://manlaws.tripod.com/](http://manlaws.tripod.com/)” + whatever i enter into url + “.txt”

thanx for your help!

ATTENTION!  
i got it to work

```auto

var man_laws:LoadVars = new LoadVars();
man_laws.onData = function(src:String):Void {
    if (src != undefined) {
        load_txt.text = src;
    } else {
        man_laws.load("http://ben-beadle.tripod.com/" + url + ".txt");;
    }
};

man_laws.load(_root.url);

```

now what i would like it to do is scroll across the screen  
any ideas?
