# Asfunction and multiple text pieces in dynamic textbox

**URL:** <https://forum.kirupa.com/t/asfunction-and-multiple-text-pieces-in-dynamic-textbox/218108>\
**Category:** Uncategorized\
**Created:** [March 5, 2007, 5:28am UTC](https://forum.kirupa.com/t/asfunction-and-multiple-text-pieces-in-dynamic-textbox/218108 "2007-03-05T05:28:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![igby](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/igby/32/2060_2.png) [@igby](https://forum.kirupa.com/u/igby)\
**Post date:** [March 5, 2007, 5:28am UTC](https://forum.kirupa.com/t/asfunction-and-multiple-text-pieces-in-dynamic-textbox/218108/1 "2007-03-05T05:28:50Z")

</div>

Hello Friends,

Here’s what I’m trying to do:

I’ve got an external text file with a bunch of pieces that I want to load via asfunction. Here’s my script:

```auto
_global.doSomething = function(what) {
    myLoadVar = new LoadVars ();
    myLoadVar.load("text/lyrics.txt")
    myLoadVar.onLoad = function (success){
        if (success == true) {
            _root.popup.fullStory.text = myLoadVar.what;
        }
    }
    _root.popup._y = 0;
    _root.popup._x = 0;
    _root.popup._alpha = 100;
}

```

Here’s the asfunction piece:  
\<a href=‘asfunction:doSomething,Surrounded’\>Surrounded\</a\>

However, this traces to “myLoadVar.Surrounded” instead of loading the proper text. Can anyone help me figure out the proper way to do this?

Thanks,  
Igby
