Dynamic Buttons pulled from a directory

Hey guys,
I have a directory of PDF’s that I am loading the names of dynamically using PHP:

My PHP file looks like this:


<?php

$dir = getcwd();
$dh  = opendir($dir);
while (($filename = readdir($dh)) == true) {
    $files[] = $filename;
}

echo "&count=" . count($files);
for($i=0; $i<count($files); $i++) {
    echo "&echo" . $i. "=" . $files[$i];
}

?>

And my Actionscript looks like this:

var LV:LoadVars = new LoadVars();
LV.onLoad = function() {
    for (i=0; i<LV.count; i++) {
        _root.attachMovie("box", "box"+i+"_mc", i, {_x:20, _y:30*i});
        _root["box"+i+"_mc"]._txt.text = LV["echo"+i];
        
    }
};
LV.sendAndLoad("catalog/readDir.php", LV, "POST");


    

Now the code works perfect and it displays the name of all the pdf’s but I want to somehow make a button on top of each displayed pdf that makes it clickable.
The code is already storing the name of the PDF’s so it should be pretty easy to do a
getURL(“pdfname”,“blank”) or whatever I just don’t know where to start.

Here is the SWF output: https://ssl.perfora.net/s246612274.onlinehome.us/securitronftp/test/getFiles.swf