I've tripped over that 'feature' while updating the music example
application to show some ID3 infos.
First I've tested "if (id3 != null)", that worked perfectly under swf9,
but it was ´false´ under swf8. Let's say, I was a bit stumped at that
time. Then I tested all these variations to find out what is so magic
about the id3-object in swf8. At least "if (!! id3)" works in both
runtimes. :-)
On 9/16/2008 4:54 PM, P T Withington wrote:
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....!?