File.list()

Availability

Flash Media Server 2.

Usage

fileObject.list(filter)

Parameters

filter A Function object that determines the files in the returned array.

If the function returns true when a file's name is passed to it as a parameter, the file is added to the array returned by File.list(). This parameter is optional and allows you to filter the results of the call.

Returns

An Array object containing all the file objects in the directory.

Description

Method; if the file is a directory, returns an array with an element for each file in the directory.

Example

The following example returns files in the current directory that have three-character names:

var a = x.currentDir.list(function(name){return name.length==3;});