Asfunction: Problem..please help

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:


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:


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

thx for any help.