mFile.copyFolder()

Availability

SupportPCMacPackage (AS3) / Scope (AS2)
ActionScript 3.0

4.0 or later

4.0 or later

stm.mprojector.mFile

ActionScript 2.0

3.1.0 or later

3.1.0 or later

global

Usage

mFile.copyFolder(sourceFolder:String, destinationFolder:String[, replaceExistingFolder:Boolean]) : Boolean

Parameters

sourceFolder - Name (including the full path) of the folder to copy.

destinationFolder - Name (including the full path) of the destination folder.

replaceExistingFolder -

  • if true, then any existing folder is overwritten.
  • if false, then the function fails if the folder already exists.
If this parameter is not specified, it will be treated as "false."

Returns

A boolean.

Description

Method; Makes a copy of the specified folder. If you want progress information, use mFile.copyFolderAsynchronously()

ActionScript 3.0 Example:

The following example copies a folder named "images" from the application's directory to the desktop.

import stm.mprojector.mFile;
import stm.mprojector.mSystem;

var success:Boolean;
var workingDirPath:String;
var desktopPath:String;
var pathDelimiter = mSystem.getPathDelimiter();

sourcePath = mSystem.getSpecialFolder("MYAPP") + pathDelimiter + "images";
desktopPath = mSystem.getSpecialFolder("DESKTOP") + pathDelimiter + "images";
success = mFile.copyFolder(workingDirPath, desktopPath, true);

ActionScript 2.0 Example:

The following example copies a folder named "images" from the application's directory to the desktop.

var success:Boolean;
var workingDirPath:String;
var desktopPath:String;
var pathDelimiter = mSystem.getPathDelimiter();

sourcePath = mSystem.getSpecialFolder("MYAPP") + pathDelimiter + "images";
desktopPath = mSystem.getSpecialFolder("DESKTOP") + pathDelimiter + "images";
success = mFile.copyFolder(workingDirPath, desktopPath, true);

See Also

mFile.copyFolderAsynchronously()