# How to load URL from .txt file and use URL to load image?

**URL:** <https://forum.kirupa.com/t/how-to-load-url-from-txt-file-and-use-url-to-load-image/257187>\
**Category:** flash\
**Created:** [April 11, 2008, 12:39am UTC](https://forum.kirupa.com/t/how-to-load-url-from-txt-file-and-use-url-to-load-image/257187 "2008-04-11T00:39:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![REEF](https://avatars.discourse-cdn.com/v4/letter/r/ce73a5/32.png) [@REEF](https://forum.kirupa.com/u/REEF)\
**Post date:** [April 11, 2008, 12:39am UTC](https://forum.kirupa.com/t/how-to-load-url-from-txt-file-and-use-url-to-load-image/257187/1 "2008-04-11T00:39:58Z")

</div>

txtfile (imageurl.txt):

```auto
img=http://www.image.com/images/home_wedding_pic.jpg

```

swf:

```auto
loadVARS = new LoadVars();
loadVARS.onLoad = function(success) {
	if (success) {
		img_container.loadMovie(this.img);
	} else {
		trace("FAILED");
	}
};

loadVARS.load("imageurl.txt");

```

This works when I hit ctrl+enter to test within the flash GUI, but not when I open the swf from my computer. wtf!

However, having a flash file with ONLY the following:

```auto
img_container.loadMovie("http://www.image.com/images/home_wedding_pic.jpg");

```

This works in flash and even from the swf itself! Somethings fishy with the loadvars method.

Using CS3, AS2.0. Thanks!
