[Laszlo-dev] Flash built-in objects

P T Withington ptw at pobox.com
Tue Sep 16 07:54:42 PDT 2008


Flash is not very good about their built-in objects behaving as objects.

Adam used to use something like this to test for an object being a  
function:

   if (x == null && (! x)) ...

So, functions are similar to null and false in a boolean context, so  
this might be part of that old hack?

On 2008-09-16, at 10:38EDT, André Bargull wrote:

> Some Flash8 built-in objects are too scary:
>
> var id3 = audioplayer.getID3(); //audioplayer is a LzView
> typeof id3; // 'object'
> typeof id3.constructor; // 'undefined' -> aha, a built-in object
> id3 == null; // true
> id3 == undefined; // true
> id3 != null; // false
> id3 != undefined; // false
> id3 === null; // false
> id3 === undefined; // false
> id3 !== null; // true
> id3 !== undefined; // true
> Finally:  !!(audioplayer.getID3()); // true
>
> Whatever their indention was....!?




More information about the Laszlo-dev mailing list