# Dynamic video file name (pass URL from external file to variable)

**URL:** <https://forum.kirupa.com/t/dynamic-video-file-name-pass-url-from-external-file-to-variable/129460>\
**Category:** Uncategorized\
**Created:** [November 23, 2004, 10:52pm UTC](https://forum.kirupa.com/t/dynamic-video-file-name-pass-url-from-external-file-to-variable/129460 "2004-11-23T22:52:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![polishbroadcast](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@polishbroadcast](https://forum.kirupa.com/u/polishbroadcast)\
**Post date:** [November 23, 2004, 10:52pm UTC](https://forum.kirupa.com/t/dynamic-video-file-name-pass-url-from-external-file-to-variable/129460/1 "2004-11-23T22:52:50Z")

</div>

I have a movie player that works fine when i hard-code the url value in the video function, but when i try to pass that url/file path from an external file, the video doesn’t load. I suspect that there is something i’m doing wrong with the quotes or maybe i just don’t get how to pass a variable to a function.

```auto
var vfile = "path";

supervideo = function () {
	var netConn:NetConnection = new NetConnection();
	netConn.connect(null);
	var netStream:NetStream = new NetStream (netConn);
	video.attachVideo(netStream);
	netStream.setBufferTime(10);
	netStream.play(vfile);
	
};

loadText.load(_global.text_url1);
loadText.onLoad = function(success) {
    if(success){	
		showtitle.text = this.title1;
		vfile = this.flv_name;
		supervideo();
		}
	}

```

The value in the php file looks like this:

```php
&flv_name="elements/flv/superape.flv"&

```

So ultimately i want to end up with

```auto
netStream.play("elements/flv/superape.flv");

```

. I have tried defining the variable w/ and w/out the “:String”. The video portion of the code seems to not use the variable correctly when it is in a function. If you have suggestions or see any errors please let me know. Thanks!

File is here (in MX format, though i am using MX2004) if you have time to take a look.
