I've made a small class that you can easily implement into your flash movie. But you need to export to flash 9. Let me know if you want a flash 8 solution.
Code:
// Only availible in flash 9 / as3
class FileLoader extends Object
{
private var loader:URLLoader;
function FileLoader()
{
this.loader = new URLLoader;
this.loader.addEventListener(Event.COMPLETE, loaderComplete);
this.loader.addEventListener(IOErrorEvent.IO_ERROR, loaderError);
}
function load(path:String):void
{
var request = new URLRequest(path);
this.loader.load(request);
}
function loaderComplete(event:Event):void
{
// here you have to change the code...
// this.loader.data is the loaded string
}
function loaderError(event:Event):void
{
// an error occured...
}
}
Your starting script has to look like this:
Code:
var loader = new FileLoader;
loader.load("http://yourdomain.com/file.txt");
And the file has to contain the url:
Code:
http://www.an.url.com/
Let me know if it works!