type (FileReference.type property)

public type : String [read-only]

The file type. In Windows, this property is the file extension. On the Macintosh, this property is the four-character file type. If the FileReference object has not been populated, a call to get the value of this property returns null.

Availability: ActionScript 1.0; Flash Player 8

Example

The following example retrieves the type of a file selected by the user.

import flash.net.FileReference;

var listener:Object = new Object();
listener.onSelect = function(file:FileReference):Void {
    trace("type: " + file.type);
}

var fileRef:FileReference = new FileReference();
fileRef.addListener(listener);
fileRef.browse();

See also

browse (FileReference.browse method)


Flash CS3