Help! XML Array elements need to be clickable

I have created an application using Flash CS3 and Actionscript 2.0 that uses an XML file to display employees names, photo, and job title. I have also implemented a search feature that allows users to search for names, etc.

When the user executes a search, the results populate a dynamic text field. I would like the users to be able to click on one of the results and have it pull up that persons corresponding photo.

At the moment, users are only able to navigate through photos using a Next and Previous button.

So the question is, how do I allow for individual elements in an array to be clickable links that bring up the data?

Here is what a portion of the code looks like (the function “displayresults” is the function that I need to modify to work, it currently only brings up the last image in the array):

function DisplayNodes (nodes, field_txt){
    field_txt.htmlText = ""; 
    var entry;
    var separator = "<br>_______________________<br>";
    
    firstname = [];
    lastname = [];
    position = [];
    photo = [];
    listnumber = [];
    
    
    
    

    for (var k=0; k<nodes.length; k++){
        
        firstname[k] = nodes[k].childNodes[0].firstChild.nodeValue;
        lastname[k] = nodes[k].childNodes[1].firstChild.nodeValue;
        position[k] = nodes[k].childNodes[2].firstChild.nodeValue;
        photo[k] = nodes[k].childNodes[3].firstChild.nodeValue;
        listnumber[k] = nodes[k].childNodes[4].firstChild.nodeValue;
        
        
        
        p = listnumber[k];
        //trace(p)
        _root.total = nodes.length
        
        
        entry = "";
        entry += "<b><a href='asfunction:gotoresult'>"+ nodes[k].childNodes[0].firstChild.nodeValue +"</a></b> ";
        entry += "<b><a href='asfunction:gotoresult'> "+ nodes[k].childNodes[1].firstChild.nodeValue +"</a></b>";
        entry += "<br><b>"+ nodes[k].childNodes[2].firstChild.nodeValue +"</b>";
        //entry += "<br>"+ nodes[k].childNodes[4].firstChild.nodeValue;
        
        field_txt.htmlText += entry + separator;
        
        firstImage();
        
    
    }
}

function gotoresult () 
    {
        
        
        picture.loadMovie(photo[p],1)
        fn_txt.text = firstname[p];
        ln_txt.text = lastname[p];
        pos_txt.text = position[p];
        picture_num();
    
    }