View comments | RSS feed

instanceof operator

object instanceof classConstructor

Tests whether object is an instance of classConstructor or a subclass of classConstructor. The instanceof operator does not convert primitive types to wrapper objects. For example, the following code returns true:

new String("Hello") instanceof String;

Whereas the following code returns false:

"Hello" instanceof String;

Availability: ActionScript 1.0; Flash Player 6

Operands

object : Object - An ActionScript object.

classConstructor : Function - A reference to an ActionScript constructor function, such as String or Date.

Returns

Boolean - If object is an instance of or a subclass of classConstructor, instanceof returns true, otherwise it returns false. Also, _global instanceof Object returns false.

See also

typeof operator


Flash CS3


Comments


dfsolley said on Jan 30, 2008 at 11:51 AM :
If the array is created in an SWF built at version 6/1 and is loaded into an SWF built as version 8/2, then instanceof in the loading component will not identify the array as an array.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00001282.html