mFile.renameFile()

Availability

Windows: Flash 8 or 9 AS2.0 SWF + mProjector 3.0; Windows 98/ME/NT Support: Flash 7 SWF + mProjector 2.0;

Macintosh: Flash 8 or 9 AS2.0 SWF + mProjector 2.0; replacing mProjector 1.0 async

Usage

mFile.renameFile(oldFileName:String, newFileName:String) : Boolean

Parameters

oldFileName - Name (including the path) of the file to rename.

newFileName - New file name (including the path).

Returns

A boolean.; ;

Description

Method; Renames the specified file or folder. By specifying different paths for the old and the new file, this function can be used to move files to another location. Platform Implementation Differences: On Windows the file name must include a fully qualified path. On the Mac if no path is specified, the working directory is used.

Example

The following example renames and moves a file.

var success:Boolean;
var workingDir:String = mSystem.getSpecialFolder("WORKING") + + mSystem.getPathDelimiter();
success = mFile.renameFile(workingDir+"/File1.txt", workingDir+"/File2.txt");

Code Examples

mProjector Class Basics -- mFile