I have been working so long on this problem and I need some help. I am using browseForDirectory to open a directory, then the files in the folder that the user chooses from are shown in a list. My problem is that I don’t know how to make these items in the list clickable so I can open them back up in a browser. The highlighted part shows where the list is being populated.
Can someone please help me?
Here is the code:
import flash.filesystem.;
import flash.events.;
import fl.controls.;
import flash.display.;
import flash.text.*;
browse_btn.addEventListener(MouseEvent.CLICK, browseFiles)
function browseFiles(e:Event):void
{
var file:File = new File();
file.addEventListener(Event.SELECT, dirSelected);
file.browseForDirectory(“Choose a folder”);
[COLOR=Navy]function dirSelected(e:Event):void
{
info.text = file.nativePath;
var desktopNodes:Array = file.getDirectoryListing();
for (var i:uint = 0; i < desktopNodes.length; i++)
{
var f:File=desktopNodes* as File;
if (f.extension=="htm"||f.extension=="html")
{
list.appendText("
" + desktopNodes*.name);
}
}
}[/COLOR]
}
If Someone could help me out it would be wonderful, thanks guys.