Choose Files

This sample shows how to use the mSystem.chooseFiles() command to enable the user to select multiple files.

Mac and Windows OS use similiar but different parameters in the choose file dialog. Windows doesn't require a file description and a default file type. Use mSystem.isMac() and mSystem.isWindows() in an if statement to handle the platform differences.

The code below enables the user to pick multiple JPEGs.

var chooseFileTitle = "Select JPGs";
var initFileName = "test.jpg";
var initFolderName = mSystem.getSpecialFolder("PICTURES");
var fileFilter:String;
var defaultFileType:String;
var fileMustExist = true;
var saveFile = false;
var selectedFiles:String;

if (mSystem.isMac()) {
	fileFilter = "jpg";
	defaultFileType = "";
} else if (mSystem.isWindows()){
	fileFilter = "JPEG Files (*.jpg)|*.jpg";		
	defaultFileType = "jpg";

chooseFiles_btn.onRelease = function() {
	var selectedFilesArray:Array = mSystem.chooseFiles(chooseFileTitle, initFileName, initFolderName, fileFilter, defaultFileType);
	selectedFiles = "";
	for (i=0; i<selectedFilesArray.length; i++) {
		selectedFiles = selectedFiles+selectedFilesArray[i]+newline;

You can download this sample, "loadSWF", from the mProjector Samples page -- /software/flash-projector/flas.html#chooseFiles.

adobe photoshop teacher discount adobe flex builder 3 professional price adobe photoshop cs6 for sale philippines acheter adobe acrobat 9 standard prix adobe illustrator cs5 discount adobe photoshop elements 9