STF.renameFile()

Availability

Flash MX 2004 or 8 swf w/ ScreenTimeScreenSaver component + ScreenTime 3.0 / 3.0

Usage

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

Parameters

oldFileName - Name of the file to rename.

newFileName - New file name.

Returns

A boolean.; This value is returned as a parameter to the registered callback. See the example below or STF.registerCallBack() for more information on return variable handling.

Description

Method; Renames the specified file. By specifying different paths for the old and the new file, this function can be used to move files to another location. If no path is specified, the working directory is used.

Example

The following example renames and moves a file.

var success:Boolean;
onRenameFileReturn = function(returnValue:Boolean) {  // callback function
	success = returnValue;
}
STF.registerCallBack("renameFile", onRenameFileReturn, this);  // register callback function
STF.renameFile("File1.txt", "File2.txt");

See Also

STF.copyFile() STF.createShortcut(), STF.deleteFile(), STF.downloadFile(), STF.renameFile()