# Load URL from External TXT File

**URL:** https://forum.kirupa.com/t/load-url-from-external-txt-file/245438
**Category:** flash
**Created:** [November 29, 2007, 6:26pm UTC](https://forum.kirupa.com/t/load-url-from-external-txt-file/245438 "2007-11-29T18:26:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mstrauss88](https://avatars.discourse-cdn.com/v4/letter/m/3be4f8/32.png) [@mstrauss88](https://forum.kirupa.com/u/mstrauss88)
#### Post date: [November 29, 2007, 6:26pm UTC](https://forum.kirupa.com/t/load-url-from-external-txt-file/245438/1 "2007-11-29T18:26:00Z")

</div>

I’d like to have button which URL changes depending on what frame I’m on. I set up a few TXTs (Pretty new to AS 3.0 and not ready for XML yet) which holds only the URL that I want to navigate to. Then, I want to be able to load different URLs on to the button on command.

In the code which I have now, I can see the url from the TXT in a trace statement, but I have no idea how to make the data useful. I’ve found many threads which make this possible in AS 2.0, but as you know, it doesn’t help me much.

Please Help! Thanks.

Here’s the code I have currently:

```auto

var loader:URLLoader = new URLLoader();
loader.load(new URLRequest("slot_a/purchaselink.txt"));

loader.addEventListener(Event.COMPLETE, linkLoaded);

function linkLoaded(event:Event):void 
{
    trace(event.target.data);
}

```
