Fl.runscript(), From within a script, use the – Adobe Extending Flash Professional CS5 User Manual
Page 274
252
EXTENDING FLASH PROFESSIONAL
flash object (fl)
Last updated 5/2/2011
Parameters
documentObject
. If documentObject refers to the active document, the Document window might
not revert until the script that calls this method finishes executing.
Returns
A Boolean value:
true
if the Revert operation completes successfully;
false
otherwise.
Description
Method; reverts the specified FLA document to its last saved version. Unlike the File
> Revert menu option, this
method does not display a warning window that asks the user to confirm the operation. See also
and
Example
The following example reverts the current FLA document to its last saved version; any changes made since the last save
are lost.
fl.revertDocument(fl.getDocumentDOM());
fl.runScript()
Availability
Flash MX 2004.
Usage
fl.runScript(fileURI [, funcName [, arg1, arg2, ...]])
Parameters
fileURI
A string, expressed as a file:/// URI, that specifies the name of the script file to execute.
funcName
A string that identifies a function to execute in the JSFL file that is specified in fileURI. This parameter is
optional.
arg
An optional parameter that specifies one or more arguments to be passed to funcname.
Returns
The function's result as a string, if funcName is specified; otherwise, nothing.
Description
Method; executes a JavaScript file. If a function is specified as one of the arguments, it runs the function and also any
code in the script that is not within the function. The rest of the code in the script runs before the function is run.
Example
Suppose there is a script file named testScript.jsfl in the root directory on the C drive and its contents are as follows: