# Asfunction: Problem..please help

**URL:** <https://forum.kirupa.com/t/asfunction-problem-please-help/235135>\
**Category:** Uncategorized\
**Created:** [August 8, 2007, 7:18pm UTC](https://forum.kirupa.com/t/asfunction-problem-please-help/235135 "2007-08-08T19:18:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![solos](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@solos](https://forum.kirupa.com/u/solos)\
**Post date:** [August 8, 2007, 7:18pm UTC](https://forum.kirupa.com/t/asfunction-problem-please-help/235135/1 "2007-08-08T19:18:04Z")

</div>

Im reading an xml file into a dynamic text box and placing frame calls with the asfunction: method…my problem is that the parameter passed is not being recognized in my gotoAndStop(_parameter_) call…im assuming the htmlText is screwing up how the parameter is recognized by flash? Any ideas?  
Dynamic text box code:

```auto

var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function() {
    var nodes = this.firstChild.childNodes;
    numOfItems = nodes.length;
    var i = 0;
       do {
        var newTextLine = "<a href=\"asfunction:playPage," + nodes*.attributes.page + " \">"+nodes*.attributes.caption + "</a>";
        myText.htmlText += newTextLine;
        i = i+1;
    } while (i<numOfItems);
};
// load the xml
xml.load("bookmarks.xml");

```

and heres my simple asfunction:

```auto

function playPage(myPage) {
      myPage = Number(myPage);
        trace("as fired");
        _root.viewport.gotoAndStop(myPage);
         _root.updateInfo();
}

```

thx for any help.
