<div dir="ltr">We just tripped over&nbsp;<div><br></div><div>(&#39;foo&#39; is String) == false in swf8 but true in swf9<br><br><div class="gmail_quote">On Tue, Sep 16, 2008 at 11:32 AM, André Bargull <span dir="ltr">&lt;<a href="mailto:andre.bargull@udo.edu">andre.bargull@udo.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I&#39;ve tripped over that &#39;feature&#39; while updating the music example application to show some ID3 infos.<br>
First I&#39;ve tested &quot;if (id3 != null)&quot;, that worked perfectly under swf9, but it was ´false´ under swf8. Let&#39;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 &quot;if (!! id3)&quot; works in both runtimes. :-)<div>
<div></div><div class="Wj3C7c"><br>
<br>
On 9/16/2008 4:54 PM, P T Withington wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Flash is not very good about their built-in objects behaving as objects.<br>
<br>
Adam used to use something like this to test for an object being a function:<br>
<br>
 &nbsp;if (x == null &amp;&amp; (! x)) ...<br>
<br>
So, functions are similar to null and false in a boolean context, so this might be part of that old hack?<br>
<br>
On 2008-09-16, at 10:38EDT, André Bargull wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Some Flash8 built-in objects are too scary:<br>
<br>
var id3 = audioplayer.getID3(); //audioplayer is a LzView<br>
typeof id3; // &#39;object&#39;<br>
typeof id3.constructor; // &#39;undefined&#39; -&gt; aha, a built-in object<br>
id3 == null; // true<br>
id3 == undefined; // true<br>
id3 != null; // false<br>
id3 != undefined; // false<br>
id3 === null; // false<br>
id3 === undefined; // false<br>
id3 !== null; // true<br>
id3 !== undefined; // true<br>
Finally: &nbsp;!!(audioplayer.getID3()); // true<br>
<br>
Whatever their indention was....!?<br>
</blockquote>
<br>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Henry Minsky<br>Software Architect<br><a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br><br><br>
</div></div>