Adding Local Filenames/References To Array In Actionscript
how can i cycle thru a local folder to add all (or some) files names and references to that file in an array using actionscript 3.0?
var fileArray:Array = new Array();
for (var item:Object in "../myFolder/")
{
trace(item.name);
fileArray.push(item);
}
something like开发者_如何学C this?
You can only access the file system using AIR :/, or by having Flex make an HTTP call to a server-side language like ruby/python/php and having it return that information.
Here is an AIR Directory Listing Example (you'll have to resize the blog's code blocks because of the formatting).
Hope that helps, Lance
精彩评论