typeof
Availability
Flash Player 5.
Usage
typeof(expression) : String
Parameters
A string, movie clip, button, object, or function.
expression
Description
Operator; a unary operator placed before a single parameter. The
Flash interpreter to evaluate
a string, movie clip, object, function, number, or Boolean value. The following table shows the
results of the
typeof
nu
Parameter
String
Movie clip
Button
Text field
Number
Boolean
Object
Function
null
undefined
Example
In the following example, all instances in a SWF file and their types are traced and written to a log
file.
for (i in _root) {
trace("_root."+i+" ("+typeof (_root[i])+")");
}
ActionScript Core Language Elements
; the result is a string specifying whether the expression is
expression
operator on each type of expression:
Output
string
movieclip
object
object
number
boolean
object
function
null
undefined
CHAPTER 5
operator causes the
typeof
typeof
223
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?