# Asfunction call inside external .txt

**URL:** <https://forum.kirupa.com/t/asfunction-call-inside-external-txt/179148>\
**Category:** Uncategorized\
**Created:** [February 17, 2006, 12:47am UTC](https://forum.kirupa.com/t/asfunction-call-inside-external-txt/179148 "2006-02-17T00:47:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frenchi](https://avatars.discourse-cdn.com/v4/letter/f/4491bb/32.png) [@Frenchi](https://forum.kirupa.com/u/Frenchi)\
**Post date:** [February 17, 2006, 12:47am UTC](https://forum.kirupa.com/t/asfunction-call-inside-external-txt/179148/1 "2006-02-17T00:47:33Z")

</div>

I have an external text file, flashData.txt, that contains data that is loaded into dynamic text fields when main.swf runs. The external .txt contains \<a href\> calls that work fine if I use them normally (i.e. \<a href=“contents/arrays1.htm”\>) but I decided that more functionality was available if I turned the \<a href\> calls into asfunction calls and used a function to declare my getURL’s. That is to say, the code now looks like the following:

Inside flashData.txt:

```auto
&entry0=<a href="asfunction:fetchURL, contents/arrays1.htm">This is a link</a>.&

```

Inside main.swf:

```auto
 
function fetchURL(arg) {
     getURL("javascript:Launch('"+arg+"', 300, 300)");
}

```

And the index.htm page containing the main.swf file contains the following script, as presented in Kirupa’s Centered Pop-Up Window tutorial:

```auto
 
<script language="JavaScript"> 
 function Launch(page, width, height) { 
  OpenWin = this.open(page, "Glider Guides", "toolbar=no, menubar=no ,location=no, scrollbars=yes, resizable=yes, width=" + width + ", height=" + height + ", top=" + (screen.height/2 - height/2) + ", left=" + (screen.width/2 - width/2) + "\""); 
 } 
</script>

```

When I run the website using the above code, and click on the link that should, theoretically, call the fetchURL function which will open a new page using javascript, nothing happens. Any suggestions?

If you need to see the current code in action, it can be seen at [http://www.gliderguides.com](http://www.gliderguides.com), under the Flash tab on the left, the entry “Working with Arrays”, and the link is down the entry a little and named “See The Results Of This Example (arrays1.swf)”. Ideally the result of the above code should open a 300x300 bare window containing just the .swf used in the tutorials example.
