<?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"
	>
<channel>
	<title>Comments on: as3 casting issue</title>
	<atom:link href="http://blog.wrench.com.au/2009/01/15/as3-casting-issue/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.wrench.com.au/2009/01/15/as3-casting-issue/</link>
	<description>Flash, Flex and Technology</description>
	<pubDate>Tue, 07 Feb 2012 19:47:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Jason Langdon</title>
		<link>http://blog.wrench.com.au/2009/01/15/as3-casting-issue/#comment-6493</link>
		<dc:creator>Jason Langdon</dc:creator>
		<pubDate>Sat, 17 Jan 2009 00:26:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.wrench.com.au/?p=212#comment-6493</guid>
		<description>Errrr, actually true is equal to "true". But it ain't equal to "" ;-)</description>
		<content:encoded><![CDATA[<p>Errrr, actually true is equal to &#8220;true&#8221;. But it ain&#8217;t equal to &#8220;&#8221; ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Tynjala</title>
		<link>http://blog.wrench.com.au/2009/01/15/as3-casting-issue/#comment-6492</link>
		<dc:creator>Josh Tynjala</dc:creator>
		<pubDate>Fri, 16 Jan 2009 20:20:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.wrench.com.au/?p=212#comment-6492</guid>
		<description>true != "true"</description>
		<content:encoded><![CDATA[<p>true != &#8220;true&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Langdon</title>
		<link>http://blog.wrench.com.au/2009/01/15/as3-casting-issue/#comment-6491</link>
		<dc:creator>Jason Langdon</dc:creator>
		<pubDate>Fri, 16 Jan 2009 12:03:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.wrench.com.au/?p=212#comment-6491</guid>
		<description>Ahhh, true dat Nat ;-)

I would normally use just the [] array literal, but was declaring this particular array amongst a bunch of others that were all using (apparently not optimally) new Array(...)

I read the conventions link you posted and I quote, "Use the Array constructor only to allocate an array of a prespecified size, as in new Array(3), which means [ undefined, undefined, undefined ], not [ 3 ]." So out with new Array() (which to be fair is a bit more descriptive) and in with [] from hence forth.</description>
		<content:encoded><![CDATA[<p>Ahhh, true dat Nat ;-)</p>
<p>I would normally use just the [] array literal, but was declaring this particular array amongst a bunch of others that were all using (apparently not optimally) new Array(&#8230;)</p>
<p>I read the conventions link you posted and I quote, &#8220;Use the Array constructor only to allocate an array of a prespecified size, as in new Array(3), which means [ undefined, undefined, undefined ], not [ 3 ].&#8221; So out with new Array() (which to be fair is a bit more descriptive) and in with [] from hence forth.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nat</title>
		<link>http://blog.wrench.com.au/2009/01/15/as3-casting-issue/#comment-6490</link>
		<dc:creator>Nat</dc:creator>
		<pubDate>Fri, 16 Jan 2009 10:17:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.wrench.com.au/?p=212#comment-6490</guid>
		<description>Why not just use the Use Array literals [] directly:

var myArray:Array = [ 1 ];

btw it's actually recommended by Adobe also:
http://opensource.adobe.com/wiki/display/flexsdk/Coding Conventions

	Do this:
		[]
	Not this:
		new Array()

	And this:
		[ 1, 2, 3 ]
	Not this:
		new Array(1, 2, 3)</description>
		<content:encoded><![CDATA[<p>Why not just use the Use Array literals [] directly:</p>
<p>var myArray:Array = [ 1 ];</p>
<p>btw it&#8217;s actually recommended by Adobe also:<br />
<a href="http://opensource.adobe.com/wiki/display/flexsdk/Coding" rel="nofollow">http://opensource.adobe.com/wiki/display/flexsdk/Coding</a> Conventions</p>
<p>	Do this:<br />
		[]<br />
	Not this:<br />
		new Array()</p>
<p>	And this:<br />
		[ 1, 2, 3 ]<br />
	Not this:<br />
		new Array(1, 2, 3)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Langdon</title>
		<link>http://blog.wrench.com.au/2009/01/15/as3-casting-issue/#comment-6489</link>
		<dc:creator>Jason Langdon</dc:creator>
		<pubDate>Thu, 15 Jan 2009 21:45:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.wrench.com.au/?p=212#comment-6489</guid>
		<description>Possibly as a reminder to myself rather than an attempt to illuminate those of you out there who have a solid grasp of as3 - defining a new Array with one numeric argument in the constructor will create an array with the specified number of empty placeholder elements. Yup, took me another 5 minutes there to figure out that Array's are behaving as they're meant to, I'm just having an off syntactical day! So if you want to add the number 1 to an new array do so like this

&lt;pre&gt;
new Array([1]);
&lt;/pre&gt;

And please don't ask why I even have to do this...</description>
		<content:encoded><![CDATA[<p>Possibly as a reminder to myself rather than an attempt to illuminate those of you out there who have a solid grasp of as3 - defining a new Array with one numeric argument in the constructor will create an array with the specified number of empty placeholder elements. Yup, took me another 5 minutes there to figure out that Array&#8217;s are behaving as they&#8217;re meant to, I&#8217;m just having an off syntactical day! So if you want to add the number 1 to an new array do so like this</p>
<pre>
new Array([1]);
</pre>
<p>And please don&#8217;t ask why I even have to do this&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Langdon</title>
		<link>http://blog.wrench.com.au/2009/01/15/as3-casting-issue/#comment-6488</link>
		<dc:creator>Jason Langdon</dc:creator>
		<pubDate>Thu, 15 Jan 2009 18:59:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.wrench.com.au/?p=212#comment-6488</guid>
		<description>@senocular - thanks for the clarification on that. I am definitely after the conversion in this instance, and didn't realise that the "as" operator wasn't doing that for me.

@Theo - hey, nice to see you on my little patch of turf and not in the Mate/asfusion forums ;-)</description>
		<content:encoded><![CDATA[<p>@senocular - thanks for the clarification on that. I am definitely after the conversion in this instance, and didn&#8217;t realise that the &#8220;as&#8221; operator wasn&#8217;t doing that for me.</p>
<p>@Theo - hey, nice to see you on my little patch of turf and not in the Mate/asfusion forums ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: senocular</title>
		<link>http://blog.wrench.com.au/2009/01/15/as3-casting-issue/#comment-6487</link>
		<dc:creator>senocular</dc:creator>
		<pubDate>Thu, 15 Jan 2009 18:55:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.wrench.com.au/?p=212#comment-6487</guid>
		<description>Constructor casting in some cases also involves a conversion function. For example, with String, String() is actually a conversion function - it's doing more than casting.  It will take a value and make it a string (usually by invoking the object's toString() method).</description>
		<content:encoded><![CDATA[<p>Constructor casting in some cases also involves a conversion function. For example, with String, String() is actually a conversion function - it&#8217;s doing more than casting.  It will take a value and make it a string (usually by invoking the object&#8217;s toString() method).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Theo</title>
		<link>http://blog.wrench.com.au/2009/01/15/as3-casting-issue/#comment-6486</link>
		<dc:creator>Theo</dc:creator>
		<pubDate>Thu, 15 Jan 2009 18:50:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.wrench.com.au/?p=212#comment-6486</guid>
		<description>Yeah, the "as" operator yields null if the cast fails, the regular cast yields an error. It's in the docs.</description>
		<content:encoded><![CDATA[<p>Yeah, the &#8220;as&#8221; operator yields null if the cast fails, the regular cast yields an error. It&#8217;s in the docs.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

