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 displayed in
the Output panel.
for (i in _root) {
trace("_root."+i+" ("+typeof (_root[i])+")");
}
988
Chapter 2: ActionScript Language Reference
ActionScript Language Reference
; 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 2
operator causes the
typeof
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?