<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Flash: Cast to Array</title>
	<link>http://www.blog.lessrain.com/flash-cast-to-array/</link>
	<description>Lessrain Blog</description>
	<pubDate>Wed, 08 Feb 2012 15:23:20 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: WORMSS</title>
		<link>http://www.blog.lessrain.com/flash-cast-to-array/#comment-138905</link>
		<dc:creator>WORMSS</dc:creator>
		<pubDate>Wed, 22 Jul 2009 10:31:21 +0000</pubDate>
		<guid>http://www.blog.lessrain.com/flash-cast-to-array/#comment-138905</guid>
		<description>&lt;p&gt;I know this was some time ago, and a AS2 problem, But I thought I would just add here [as its currently high ranked in google] that in AS3 there is a solution which is&lt;/p&gt;

&lt;p&gt;(a[1] as Array) and you keep ur strong Casting that way such as
(a[1] as Array).pop();
(a[1] as Array).push(5);&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I know this was some time ago, and a AS2 problem, But I thought I would just add here [as its currently high ranked in google] that in AS3 there is a solution which is</p>
<p>(a[1] as Array) and you keep ur strong Casting that way such as<br />
(a[1] as Array).pop();<br />
(a[1] as Array).push(5);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stu</title>
		<link>http://www.blog.lessrain.com/flash-cast-to-array/#comment-137927</link>
		<dc:creator>Stu</dc:creator>
		<pubDate>Thu, 27 Nov 2008 14:38:30 +0000</pubDate>
		<guid>http://www.blog.lessrain.com/flash-cast-to-array/#comment-137927</guid>
		<description>&lt;p&gt;I found this entry while trying to get round the same casting issue.&lt;/p&gt;

&lt;p&gt;I finally got around the problem by creating a new Array and concat'ing the required index of the original:&lt;/p&gt;

&lt;p&gt;var arr1:Array = new Array(new Array(1,2,3), new Array(4,5,6));&lt;/p&gt;

&lt;p&gt;var arr2:Array = new Array().concat(arr1[0]);&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I found this entry while trying to get round the same casting issue.</p>
<p>I finally got around the problem by creating a new Array and concat&#8217;ing the required index of the original:</p>
<p>var arr1:Array = new Array(new Array(1,2,3), new Array(4,5,6));</p>
<p>var arr2:Array = new Array().concat(arr1[0]);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sputnikenmeister</title>
		<link>http://www.blog.lessrain.com/flash-cast-to-array/#comment-61946</link>
		<dc:creator>Sputnikenmeister</dc:creator>
		<pubDate>Thu, 19 Apr 2007 20:47:50 +0000</pubDate>
		<guid>http://www.blog.lessrain.com/flash-cast-to-array/#comment-61946</guid>
		<description>&lt;p&gt;This is humiliating for Macromedia and/or the ECMA guys...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This is humiliating for Macromedia and/or the ECMA guys&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lessrain blog  &#187; Blog Archive   &#187; Flash: Cast to Array with MTASC</title>
		<link>http://www.blog.lessrain.com/flash-cast-to-array/#comment-34082</link>
		<dc:creator>lessrain blog  &#187; Blog Archive   &#187; Flash: Cast to Array with MTASC</dc:creator>
		<pubDate>Fri, 20 Oct 2006 14:37:22 +0000</pubDate>
		<guid>http://www.blog.lessrain.com/flash-cast-to-array/#comment-34082</guid>
		<description>&lt;p&gt;[...] ay with MTASC
            October 20th, 2006 by Thomas &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;            Just had some new insight on the Cast to Array problem I had posted a while ago.  For the Flash IDE compiler the following 3 lines are synonym [...]
&lt;/code&gt;&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>[&#8230;] ay with MTASC<br />
            October 20th, 2006 by Thomas </p>
<pre><code>            Just had some new insight on the Cast to Array problem I had posted a while ago.  For the Flash IDE compiler the following 3 lines are synonym [...]
</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: BobBarker</title>
		<link>http://www.blog.lessrain.com/flash-cast-to-array/#comment-3276</link>
		<dc:creator>BobBarker</dc:creator>
		<pubDate>Tue, 09 May 2006 19:26:15 +0000</pubDate>
		<guid>http://www.blog.lessrain.com/flash-cast-to-array/#comment-3276</guid>
		<description>&lt;p&gt;var a:Object= [[1, 2], [3, 4]];
var b:Array = Array(a)[0];&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>var a:Object= [[1, 2], [3, 4]];<br />
var b:Array = Array(a)[0];</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Psykovsky</title>
		<link>http://www.blog.lessrain.com/flash-cast-to-array/#comment-308</link>
		<dc:creator>Psykovsky</dc:creator>
		<pubDate>Sun, 25 Sep 2005 00:12:29 +0000</pubDate>
		<guid>http://www.blog.lessrain.com/flash-cast-to-array/#comment-308</guid>
		<description>&lt;p&gt;damn html filters...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>damn html filters&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Psykovsky</title>
		<link>http://www.blog.lessrain.com/flash-cast-to-array/#comment-307</link>
		<dc:creator>Psykovsky</dc:creator>
		<pubDate>Sun, 25 Sep 2005 00:11:52 +0000</pubDate>
		<guid>http://www.blog.lessrain.com/flash-cast-to-array/#comment-307</guid>
		<description>&lt;p&gt;I see that prevous code is corrupted :/&lt;/p&gt;

&lt;p&gt;here it is:
var a:Array = [[1, 2], [3, 4]];
var b:Array = Array();
for (i=0; i&lt;a&gt;&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I see that prevous code is corrupted :/</p>
<p>here it is:<br />
var a:Array = [[1, 2], [3, 4]];<br />
var b:Array = Array();<br />
for (i=0; i<a></a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Psykovsky</title>
		<link>http://www.blog.lessrain.com/flash-cast-to-array/#comment-306</link>
		<dc:creator>Psykovsky</dc:creator>
		<pubDate>Sun, 25 Sep 2005 00:10:29 +0000</pubDate>
		<guid>http://www.blog.lessrain.com/flash-cast-to-array/#comment-306</guid>
		<description>&lt;p&gt;oh, also you can do this in more shorter code:&lt;/p&gt;

&lt;p&gt;var a:Array = [[1, 2], [3, 4]];
var b:Array = (String(a[0])).split(',');
trace(b[0]);&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>oh, also you can do this in more shorter code:</p>
<p>var a:Array = [[1, 2], [3, 4]];<br />
var b:Array = (String(a[0])).split(&#8217;,');<br />
trace(b[0]);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Psykovsky</title>
		<link>http://www.blog.lessrain.com/flash-cast-to-array/#comment-305</link>
		<dc:creator>Psykovsky</dc:creator>
		<pubDate>Sun, 25 Sep 2005 00:08:52 +0000</pubDate>
		<guid>http://www.blog.lessrain.com/flash-cast-to-array/#comment-305</guid>
		<description>&lt;p&gt;Well, there's one clean way of doing this:&lt;/p&gt;

&lt;p&gt;var a:Array = [[1, 2], [3, 4]];
var b:Array = Array();
for (i=0; i&lt;a&gt;&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Well, there&#8217;s one clean way of doing this:</p>
<p>var a:Array = [[1, 2], [3, 4]];<br />
var b:Array = Array();<br />
for (i=0; i<a></a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luis</title>
		<link>http://www.blog.lessrain.com/flash-cast-to-array/#comment-243</link>
		<dc:creator>Luis</dc:creator>
		<pubDate>Thu, 15 Sep 2005 17:14:22 +0000</pubDate>
		<guid>http://www.blog.lessrain.com/flash-cast-to-array/#comment-243</guid>
		<description>&lt;p&gt;And this is my latest surreal and not reccomendable solution:&lt;/p&gt;

&lt;p&gt;Object.prototype=Array.prototype;
var a:Object = [ [1, 2], [3, 4] ];
var b:Object = Object(a[0]);
trace(b.pop());&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>And this is my latest surreal and not reccomendable solution:</p>
<p>Object.prototype=Array.prototype;<br />
var a:Object = [ [1, 2], [3, 4] ];<br />
var b:Object = Object(a[0]);<br />
trace(b.pop());</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luis</title>
		<link>http://www.blog.lessrain.com/flash-cast-to-array/#comment-242</link>
		<dc:creator>Luis</dc:creator>
		<pubDate>Thu, 15 Sep 2005 16:46:58 +0000</pubDate>
		<guid>http://www.blog.lessrain.com/flash-cast-to-array/#comment-242</guid>
		<description>&lt;p&gt;Oi..  but still weird...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Oi..  but still weird&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas</title>
		<link>http://www.blog.lessrain.com/flash-cast-to-array/#comment-241</link>
		<dc:creator>Thomas</dc:creator>
		<pubDate>Thu, 15 Sep 2005 16:44:59 +0000</pubDate>
		<guid>http://www.blog.lessrain.com/flash-cast-to-array/#comment-241</guid>
		<description>&lt;p&gt;Mr. Luis Alberto showed me how to work around it and still keep the code compact. As Objects also allow for bracket access, you can write:&lt;/p&gt;

&lt;p&gt;trace(Object(a[0])[0]); // "1"&lt;/p&gt;

&lt;p&gt;You still couldn't do Array(a[0]).pop() or other Array specific operations though and the code would hide the fact that we're dealing with an Array which is not the point of strict typing....&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Mr. Luis Alberto showed me how to work around it and still keep the code compact. As Objects also allow for bracket access, you can write:</p>
<p>trace(Object(a[0])[0]); // &#8220;1&#8243;</p>
<p>You still couldn&#8217;t do Array(a[0]).pop() or other Array specific operations though and the code would hide the fact that we&#8217;re dealing with an Array which is not the point of strict typing&#8230;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

