This section contains a set of built-in functions that are available in any part of a SWF file where ActionScript is used. These global functions cover a wide variety of common programming tasks such as working with data types (Boolean(), int(), and so on), producing debugging information (trace()), and communicating with Flash Player or the browser (fscommand()).
|
Modifiers |
Signature |
Description |
|---|---|---|
|
|
Array([numElements], [elementN]) : Array |
Creates a new, empty array or converts specified elements to an array. |
|
|
Boolean(expression:Object) : Boolean |
Converts the parameter expression to a Boolean value and returns true or false. |
|
|
call(frame:Object) |
Deprecated since Flash Player 5. This action was deprecated in favor of the function statement. Executes the script in the called frame without moving the playhead to that frame. |
|
|
chr(number:Number) : String |
Deprecated since Flash Player 5. This function was deprecated in favor of String.fromCharCode(). Converts ASCII code numbers to characters. |
|
|
clearInterval(intervalID:Number) |
Cancels an interval created by a call to setInterval(). |
|
|
duplicateMovieClip(target:Object, newname:String, depth:Number) |
Creates an instance of a movie clip while the SWF file is playing. |
|
|
escape(expression:String) : String |
Converts the parameter to a string and encodes it in a URL-encoded format, where all nonalphanumeric characters are replaced with % hexadecimal sequences. |
|
|
eval(expression:Object) : Object |
Accesses variables, properties, objects, or movie clips by name. |
|
|
fscommand(command:String, parameters:String) |
Lets a SWF file communicate with the Flash Lite player or the environment for a mobile device (such as an operating system). |
|
|
fscommand2(command:String, parameters:String) |
Lets the SWF file communicate with the Flash Lite player or a host application on a mobile device. |
|
|
getProperty(my_mc:Object, property:Object) : Object |
Deprecated since Flash Player 5. This function was deprecated in favor of the dot syntax, which was introduced in Flash Player 5. Returns the value of the specified property for the movie clip my_mc. |
|
|
getTimer() : Number |
Returns the number of milliseconds that have elapsed since the SWF file started playing. |
|
|
getURL(url:String, [window:String], [method:String]) |
Loads a document from a specific URL into a window or passes variables to another application at a defined URL. |
|
|
getVersion() : String |
Returns a string containing Flash Player version and platform information. |
|
|
gotoAndPlay([scene:String], frame:Object) |
Sends the playhead to the specified frame in a scene and plays from that frame. |
|
|
gotoAndStop([scene:String], frame:Object) |
Sends the playhead to the specified frame in a scene and stops it. |
|
|
ifFrameLoaded([scene:String], frame:Object, statement(s):Object) |
Deprecated since Flash Player 5. This function has been deprecated. Adobe recommends that you use the MovieClip._framesloaded property. Checks whether the contents of a specific frame are available locally. |
|
|
int(value:Number) : Number |
Deprecated since Flash Player 5. This function was deprecated in favor of Math.round(). Converts a decimal number to an integer value by truncating the decimal value. |
|
|
isFinite(expression:Object) : Boolean |
Evaluates expression and returns true if it is a finite number or false if it is infinity or negative infinity. |
|
|
isNaN(expression:Object) : Boolean |
Evaluates the parameter and returns true if the value is NaN (not a number). |
|
|
length(expression:String, variable:Object) : Number |
Deprecated since Flash Player 5. This function, along with all the string functions, has been deprecated. Adobe recommends that you use the methods of the String class and the String.length property to perform the same operations. Returns the length of the specified string or variable. |
|
|
loadMovie(url:String, target:Object, [method:String]) |
Loads a SWF or JPEG file into Flash Player while the original SWF file plays. |
|
|
loadMovieNum(url:String, level:Number, [method:String]) |
Loads a SWF or JPEG file into a level in Flash Player while the originally loaded SWF file plays. |
|
|
loadVariables(url:String, target:Object, [method:String]) |
Reads data from an external file, such as a text file or text generated by ColdFusion, a CGI script, Active Server Pages (ASP), PHP, or Perl script, and sets the values for variables in a target movie clip. |
|
|
loadVariablesNum(url:String, level:Number, [method:String]) |
Reads data from an external file, such as a text file or text generated by a ColdFusion, CGI script, ASP, PHP, or Perl script, and sets the values for variables in a Flash Player level. |
|
|
mbchr(number:Number) |
Deprecated since Flash Player 5. This function was deprecated in favor of the String.fromCharCode() method. Converts an ASCII code number to a multibyte character. |
|
|
mblength(string:String) : Number |
Deprecated since Flash Player 5. This function was deprecated in favor of the String.length property. Returns the length of the multibyte character string. |
|
|
mbord(character:String) : Number |
Deprecated since Flash Player 5. This function was deprecated in favor of String.charCodeAt() method. Converts the specified character to a multibyte number. |
|
|
mbsubstring(value:String, index:Number, count:Number) : String |
Deprecated since Flash Player 5. This function was deprecated in favor of String.substr() method. Extracts a new multibyte character string from a multibyte character string. |
|
|
Sends the playhead to the next frame. |
|
|
|
Sends the playhead to Frame 1 of the next scene. |
|
|
|
Number(expression:Object) : Number |
Converts the parameter expression to a number. |
|
|
Object([value:Object]) : Object |
Creates a new empty object or converts the specified number, string, or Boolean value to an object. |
|
|
on(mouseEvent:Object) |
Specifies the mouse event or keypress that triggers an action. |
|
|
onClipEvent(movieEvent:Object) |
Triggers actions defined for a specific instance of a movie clip. |
|
|
ord(character:String) : Number |
Deprecated since Flash Player 5. This function was deprecated in favor of the methods and properties of the String class. Converts characters to ASCII code numbers. |
|
|
parseFloat(string:String) : Number |
Converts a string to a floating-point number. |
|
|
parseInt(expression:String, [radix:Number]) : Number |
Converts a string to an integer. |
|
|
play() |
Moves the playhead forward in the Timeline. |
|
|
Sends the playhead to the previous frame. |
|
|
|
Sends the playhead to Frame 1 of the previous scene. |
|
|
|
random(value:Number) : Number |
Deprecated since Flash Player 5. This function was deprecated in favor of Math.random(). Returns a random integer between 0 and one less than the integer specified in the value parameter. |
|
|
removeMovieClip(target:Object) |
Deletes the specified movie clip. |
|
|
setInterval(functionName:Object, interval:Number, [param:Object], objectName:Object, methodName:String) : Number |
Calls a function or a method or an object at periodic intervals while a SWF file plays. |
|
|
setProperty(target:Object, property:Object, expression:Object) |
Changes a property value of a movie clip as the movie clip plays. |
|
|
startDrag(target:Object, [lock:Boolean], [left,top,right,bottom:Number]) |
Makes the target movie clip draggable while the movie plays. |
|
|
stop() |
Stops the SWF file that is currently playing. |
|
|
Stops all sounds currently playing in a SWF file without stopping the playhead. |
|
|
|
stopDrag() |
Stops the current drag operation. |
|
|
String(expression:Object) : String |
Returns a string representation of the specified parameter. |
|
|
substring(string:String, index:Number, count:Number) : String |
Deprecated since Flash Player 5. This function was deprecated in favor of String.substr(). Extracts part of a string. |
|
|
targetPath(targetObject:Object) : String |
Returns a string containing the target path of movieClipObject. |
|
|
tellTarget(target:String, statement(s):Object) |
Deprecated since Flash Player 5. Adobe recommends that you use dot (.) notation and the with statement. Applies the instructions specified in the statements parameter to the Timeline specified in the target parameter. |
|
|
Deprecated since Flash Player 5. This function was deprecated in favor of _quality. Turns anti-aliasing on and off in Flash Player. |
|
|
|
trace(expression:Object) |
Evaluates the expression and outputs the result. |
|
|
unescape(string:String) : String |
Evaluates the parameter x as a string, decodes the string from URL-encoded format (converting all hexadecimal sequences to ASCII characters), and returns the string. |
|
|
unloadMovie(target) |
Removes a movie clip that was loaded by means of loadMovie() from Flash Player. |
|
|
unloadMovieNum(level:Number) |
Removes a SWF or image that was loaded by means of loadMovieNum() from Flash Player. |