<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: Actionscript 2 Mystery of the day</title>
	<atom:link href="http://www.razorberry.com/blog/archives/2006/08/22/actionscript-2-mystery-of-the-day/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.razorberry.com/blog/archives/2006/08/22/actionscript-2-mystery-of-the-day/</link>
	<description>since 2004!</description>
	<pubDate>Wed, 07 Jan 2009 04:19:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Nikola</title>
		<link>http://www.razorberry.com/blog/archives/2006/08/22/actionscript-2-mystery-of-the-day/comment-page-1/#comment-2252</link>
		<dc:creator>Nikola</dc:creator>
		<pubDate>Wed, 05 Dec 2007 18:36:59 +0000</pubDate>
		<guid isPermaLink="false">/?p=37#comment-2252</guid>
		<description>:roll::roll::roll::roll::roll: nice i thing there is error</description>
		<content:encoded><![CDATA[<p>:roll::roll::roll::roll::roll: nice i thing there is error</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lisandro Puzzolo</title>
		<link>http://www.razorberry.com/blog/archives/2006/08/22/actionscript-2-mystery-of-the-day/comment-page-1/#comment-1890</link>
		<dc:creator>Lisandro Puzzolo</dc:creator>
		<pubDate>Tue, 03 Apr 2007 22:50:55 +0000</pubDate>
		<guid isPermaLink="false">/?p=37#comment-1890</guid>
		<description>Actually, there is a "bug?" in Actionscript implementation.. The following code doesn't work:

function a(){return "a"};
function b(){return "b"};
trace ( (a&#124;&#124;b) () ); // this should trace "a" but traces "undefined";

trace ( Function(a&#124;&#124;b)()) ; //this DO trace "a";</description>
		<content:encoded><![CDATA[<p>Actually, there is a &#8220;bug?&#8221; in Actionscript implementation.. The following code doesn&#8217;t work:</p>
<p>function a(){return &#8220;a&#8221;};<br />
function b(){return &#8220;b&#8221;};<br />
trace ( (a||b) () ); // this should trace &#8220;a&#8221; but traces &#8220;undefined&#8221;;</p>
<p>trace ( Function(a||b)()) ; //this DO trace &#8220;a&#8221;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niocola Marini</title>
		<link>http://www.razorberry.com/blog/archives/2006/08/22/actionscript-2-mystery-of-the-day/comment-page-1/#comment-1215</link>
		<dc:creator>Niocola Marini</dc:creator>
		<pubDate>Wed, 30 Aug 2006 21:38:33 +0000</pubDate>
		<guid isPermaLink="false">/?p=37#comment-1215</guid>
		<description>trace( (0 &#124;&#124; 23) ); //return 23
trace( (1 &#124;&#124; 23) ); //return 1
trace((Number(1) == true ? 0 : 23)); // returns 0

mistery solved, but
a question ... what are code-gnomes ?
Are like ants, or  the small mouse that make cofe in the automated machine
 here in italy? Are code-gnomes that bring me the result of a formula ?
(somtime they are drunken ! )</description>
		<content:encoded><![CDATA[<p>trace( (0 || 23) ); //return 23<br />
trace( (1 || 23) ); //return 1<br />
trace((Number(1) == true ? 0 : 23)); // returns 0</p>
<p>mistery solved, but<br />
a question &#8230; what are code-gnomes ?<br />
Are like ants, or  the small mouse that make cofe in the automated machine<br />
 here in italy? Are code-gnomes that bring me the result of a formula ?<br />
(somtime they are drunken ! )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adam</title>
		<link>http://www.razorberry.com/blog/archives/2006/08/22/actionscript-2-mystery-of-the-day/comment-page-1/#comment-1214</link>
		<dc:creator>adam</dc:creator>
		<pubDate>Fri, 25 Aug 2006 02:56:23 +0000</pubDate>
		<guid isPermaLink="false">/?p=37#comment-1214</guid>
		<description>Weird,

trace((Number(0) &#124;&#124; Number(23))); // returns 23
trace((Number(0) == false ? 0 : 23)); // returns 0

Should Flash fundamentally be doing the same evaluation on both traces?
The first trace says, if the first part is true, return it, if not, return the second half. The second trace is doing the same thing, except Im spelling it out for flash.  Because, Flash evaluates Number(0) as false.

Oh yea, no code-gnomes were harmed in the execution of this experiment.</description>
		<content:encoded><![CDATA[<p>Weird,</p>
<p>trace((Number(0) || Number(23))); // returns 23<br />
trace((Number(0) == false ? 0 : 23)); // returns 0</p>
<p>Should Flash fundamentally be doing the same evaluation on both traces?<br />
The first trace says, if the first part is true, return it, if not, return the second half. The second trace is doing the same thing, except Im spelling it out for flash.  Because, Flash evaluates Number(0) as false.</p>
<p>Oh yea, no code-gnomes were harmed in the execution of this experiment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Janousek</title>
		<link>http://www.razorberry.com/blog/archives/2006/08/22/actionscript-2-mystery-of-the-day/comment-page-1/#comment-1213</link>
		<dc:creator>Scott Janousek</dc:creator>
		<pubDate>Wed, 23 Aug 2006 17:09:33 +0000</pubDate>
		<guid isPermaLink="false">/?p=37#comment-1213</guid>
		<description>You have to enter 4 8 15 16 first, THEN 23, followed by 42! 

Confused?! Watch the orientation film produced by Hanso Corporation. 

:)</description>
		<content:encoded><![CDATA[<p>You have to enter 4 8 15 16 first, THEN 23, followed by 42! </p>
<p>Confused?! Watch the orientation film produced by Hanso Corporation. </p>
<p> <img src='http://www.razorberry.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://www.razorberry.com/blog/archives/2006/08/22/actionscript-2-mystery-of-the-day/comment-page-1/#comment-1212</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Tue, 22 Aug 2006 21:04:03 +0000</pubDate>
		<guid isPermaLink="false">/?p=37#comment-1212</guid>
		<description>That's a good try Keith, but you forgot the part about the code-gnomes toiling for hours in the caves of Ecma to bring us these return values. Reportedly, many gnomes perish each day just to maintain the supply of Boolean return values we developers consume in just one debug session. ;)</description>
		<content:encoded><![CDATA[<p>That&#8217;s a good try Keith, but you forgot the part about the code-gnomes toiling for hours in the caves of Ecma to bring us these return values. Reportedly, many gnomes perish each day just to maintain the supply of Boolean return values we developers consume in just one debug session. <img src='http://www.razorberry.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sven</title>
		<link>http://www.razorberry.com/blog/archives/2006/08/22/actionscript-2-mystery-of-the-day/comment-page-1/#comment-1211</link>
		<dc:creator>Sven</dc:creator>
		<pubDate>Tue, 22 Aug 2006 20:38:13 +0000</pubDate>
		<guid isPermaLink="false">/?p=37#comment-1211</guid>
		<description>Weird,

anyway, it works this way:

var result:Boolean = Boolean(0 &#124;&#124; 1);
trace(result);</description>
		<content:encoded><![CDATA[<p>Weird,</p>
<p>anyway, it works this way:</p>
<p>var result:Boolean = Boolean(0 || 1);<br />
trace(result);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Peters</title>
		<link>http://www.razorberry.com/blog/archives/2006/08/22/actionscript-2-mystery-of-the-day/comment-page-1/#comment-1210</link>
		<dc:creator>Keith Peters</dc:creator>
		<pubDate>Tue, 22 Aug 2006 20:28:42 +0000</pubDate>
		<guid isPermaLink="false">/?p=37#comment-1210</guid>
		<description>the way flash handles boolean ORs is it evaluates the first half. If it evals to true, it returns the first half. If it evals to false, it returns the second half. It doesn't convert what it returns, just returns the raw value. If you actually had boolean values in there, trace(false &#124;&#124; true) it would return the second value, true. But since 0 evaluates to false, it just returns 23.</description>
		<content:encoded><![CDATA[<p>the way flash handles boolean ORs is it evaluates the first half. If it evals to true, it returns the first half. If it evals to false, it returns the second half. It doesn&#8217;t convert what it returns, just returns the raw value. If you actually had boolean values in there, trace(false || true) it would return the second value, true. But since 0 evaluates to false, it just returns 23.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
