<?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: &quot;Or&quot; Inline Conditionals</title>
	<atom:link href="http://www.stevensacks.net/2007/02/02/inline-conditionals/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stevensacks.net/2007/02/02/inline-conditionals/</link>
	<description>Adobe, Flash, Flex, AIR, Technology</description>
	<lastBuildDate>Wed, 28 Jul 2010 13:21:51 -0700</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
	<item>
		<title>By: Steven Sacks</title>
		<link>http://www.stevensacks.net/2007/02/02/inline-conditionals/comment-page-1/#comment-31</link>
		<dc:creator>Steven Sacks</dc:creator>
		<pubDate>Mon, 28 May 2007 01:05:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevensacks.net/2007/02/02/inline-conditionals/#comment-31</guid>
		<description>Thanks for pointing out that error. I&#039;ve updated my post to reflect it.</description>
		<content:encoded><![CDATA[<p>Thanks for pointing out that error. I&#039;ve updated my post to reflect it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juan Pablo Califano</title>
		<link>http://www.stevensacks.net/2007/02/02/inline-conditionals/comment-page-1/#comment-30</link>
		<dc:creator>Juan Pablo Califano</dc:creator>
		<pubDate>Sun, 27 May 2007 23:22:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevensacks.net/2007/02/02/inline-conditionals/#comment-30</guid>
		<description>Hi, if I&#039;m not mistaken, the rules for evaluating whether the expression is true or false are the same.

My understanding is that a String object and a string literal are actually two very different types. While a string literal is a primitive type, a String object is a complex-type (or composite-type or reference) that wraps a primitive value - a string literal.  

As you point out, the values undefined/null/0/&quot;&quot; are evaluated to false; any other value evaluates to true. An empty string literal would then evaluate to false. However, a String object with an empty string as a value would not evaluate to false, cause the object itself is not undefined, null, 0 or &quot;&quot;.
  
A simple example to illustrate the point:

var objFoo:String = new String(&quot;&quot;);
var litFoo:String = &quot;&quot;;

if(objFoo) {
	trace(&quot;objFoo evaluates to true&quot;);
} else {
	trace(&quot;objFoo evaluates to false&quot;);
}

if(litFoo) {
	trace(&quot;litFoo evaluates to true&quot;);
} else {
	trace(&quot;litFoo evaluates to false&quot;);
}

The result in the output panel is:

objFoo evaluates to true
litFoo evaluates to false

So, I believe the same rules apply to both the inline conditional and the if statement.

Cheers

PS: I&#039;m looking forward to try your framework!</description>
		<content:encoded><![CDATA[<p>Hi, if I&#039;m not mistaken, the rules for evaluating whether the expression is true or false are the same.</p>
<p>My understanding is that a String object and a string literal are actually two very different types. While a string literal is a primitive type, a String object is a complex-type (or composite-type or reference) that wraps a primitive value &#8211; a string literal.  </p>
<p>As you point out, the values undefined/null/0/&#034;" are evaluated to false; any other value evaluates to true. An empty string literal would then evaluate to false. However, a String object with an empty string as a value would not evaluate to false, cause the object itself is not undefined, null, 0 or &#034;&#034;.</p>
<p>A simple example to illustrate the point:</p>
<p>var objFoo:String = new String(&#034;&#034;);<br />
var litFoo:String = &#034;&#034;;</p>
<p>if(objFoo) {<br />
	trace(&#034;objFoo evaluates to true&#034;);<br />
} else {<br />
	trace(&#034;objFoo evaluates to false&#034;);<br />
}</p>
<p>if(litFoo) {<br />
	trace(&#034;litFoo evaluates to true&#034;);<br />
} else {<br />
	trace(&#034;litFoo evaluates to false&#034;);<br />
}</p>
<p>The result in the output panel is:</p>
<p>objFoo evaluates to true<br />
litFoo evaluates to false</p>
<p>So, I believe the same rules apply to both the inline conditional and the if statement.</p>
<p>Cheers</p>
<p>PS: I&#039;m looking forward to try your framework!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thomas</title>
		<link>http://www.stevensacks.net/2007/02/02/inline-conditionals/comment-page-1/#comment-20</link>
		<dc:creator>thomas</dc:creator>
		<pubDate>Mon, 07 May 2007 08:31:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevensacks.net/2007/02/02/inline-conditionals/#comment-20</guid>
		<description>I stumbled across something like that in a book on Lua coding and use it in AS ever since...Nice.</description>
		<content:encoded><![CDATA[<p>I stumbled across something like that in a book on Lua coding and use it in AS ever since&#8230;Nice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: _flaflip</title>
		<link>http://www.stevensacks.net/2007/02/02/inline-conditionals/comment-page-1/#comment-8</link>
		<dc:creator>_flaflip</dc:creator>
		<pubDate>Wed, 07 Feb 2007 08:36:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevensacks.net/2007/02/02/inline-conditionals/#comment-8</guid>
		<description>Nice one Steven. I just came across this conditional in Peter Elst&#124;Todd Yard&#039;s Object-Oriented Actionscript for Flash 8, and was wondering about its details.</description>
		<content:encoded><![CDATA[<p>Nice one Steven. I just came across this conditional in Peter Elst|Todd Yard&#039;s Object-Oriented Actionscript for Flash 8, and was wondering about its details.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
