<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The paperCrane's view from the reverseFold &#187; AS2</title>
	<atom:link href="http://www.reversefold.com/blog/tag/as2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.reversefold.com/blog</link>
	<description>Flex, PHP, and anything else I care to talk about</description>
	<lastBuildDate>Sat, 24 Jul 2010 04:55:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>AS3 can solve more brain teasers than AS2</title>
		<link>http://www.reversefold.com/blog/2007/11/07/as3-can-solve-more-brain-teasers-than-as2/</link>
		<comments>http://www.reversefold.com/blog/2007/11/07/as3-can-solve-more-brain-teasers-than-as2/#comments</comments>
		<pubDate>Thu, 08 Nov 2007 04:55:39 +0000</pubDate>
		<dc:creator>papercrane</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[AS2]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[regression]]></category>

		<guid isPermaLink="false">http://www.reversefold.com/wordpress/?p=8</guid>
		<description><![CDATA[In one of my flash applications I take in some text (HTML) and do some processing (convert to plaintext). Since this was written in AS2, which doesn&#8217;t have regular expressions or a String.replace() function we came up with a simple alternative. split().join(). This worked exactly as we wanted, replacing the text passed to split() with [...]]]></description>
			<content:encoded><![CDATA[<p>In one of my flash applications I take in some text (HTML) and do some processing (convert to plaintext). Since this was written in AS2, which doesn&#8217;t have regular expressions or a <tt>String.replace()</tt> function we came up with a simple alternative. <tt>split().join()</tt>. This worked exactly as we wanted, replacing the text passed to <tt>split()</tt> with the text passed to <tt>join()</tt>. Part of this conversion was to compress 3 or more newlines into only 2 newlines. This would be easy with a regular expression but with only <tt>split().join()</tt> I had to run this through a while loop in order to compress 3 or more newlines into only 2 newlines. This was the code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>str.<span style="color: #0066CC;">indexOf</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">!</span>= -<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
      str = str.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">join</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>A very simple loop that, if it works correctly, will compress any number of 3 or more consecutive newlines into only 2 newlines. Needless to say it did work correctly in our AS2 application.</p>
<p>In January of this year I started converting our AS2 application to AS3 and Flex. Since we still had need of this conversion and the code should have worked fine in AS3 I copied it over and all seemed well. However, after testing for a while we started to get hangs of the application at a certain point. One of our developers traced it to an infinite loop&#8230;.the while loop above. He then debugged into the loop, found that the array returned by <tt>split()</tt> had an empty string in it, and added some code to remove an empty string, should one be found.</p>
<p>When I saw the commit I was baffled. This looked like added code to solve a problem that didn&#8217;t exist. After all, this code had worked fine in AS2 and it was self-evident that the number of newlines would always reduce, as 3 newlines were always replaced by 2&#8230;&#8230;or were they?</p>
<p>After a back and forth with the developer in question I had a small reproduction script which would loop infinitely, despite the fact that it was replacing 3 newlines with 2. I decided to write my own simple test case and check the output in AS2 and AS3. To simplify things I used simple characters instead of newlines:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;abbbbc&quot;</span>.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;bbb&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">join</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;bb&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Run in AS2 I get <tt>"abbbc"</tt>, a reduction of 1 <tt>'b'</tt> from the string, as expected. Run in AS3, however I get back the exact same string: <tt>"abbbbc"</tt>. Curious, I tried the following:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;abbbc&quot;</span>.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;bb&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">join</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;b&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>This produced the same result in both AS2 and AS3, <tt>"abbc"</tt>, a reduction of 1 <tt>'b'</tt>, as expected.  I then tried the next case up:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;abbbbbc&quot;</span>.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;bbbb&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">join</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;bbb&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>This code returned <tt>"abbbbc"</tt> in AS2, again as expected, but in AS3 returned <tt>"abbbbbbc"</tt>, an <strong>increase</strong> of 1 <tt>'b'</tt>!</p>
<p>Well, I had obviously found a regression in AS3 vs AS2. I then tried regular expressions to see if the same thing happened with them:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;abbbbc&quot;</span>.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">/</span>bbb<span style="color: #66cc66;">/</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">join</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;bb&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>This, (in AS3 of course, AS2 doesn&#8217;t have regular expressions) produced the desired output of <tt>"abbbc"</tt>. In my searching I also noticed that String has a <tt>replace()</tt> method in AS3 which will do global replacements if the regex has a <tt>'g'</tt> modifier. Now that I had found a solution I switched all of our <tt>split().join()</tt> mess to use <tt>replace()</tt> with a global regex. Furthermore I replaced the while loop above with a single replace call with a regular expression, as I had wanted to do when I first wrote it, hence:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">str = str.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">/</span>\n\n\n+<span style="color: #66cc66;">/</span>, <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>I also tried replace to see if ir exhibited the same problem as <tt>split().join()</tt>:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;abbbbc&quot;</span>.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;bbb&quot;</span>, <span style="color: #ff0000;">&quot;bb&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>AS3 reported <tt>"abbbc"</tt>, the wanted output, so the problem is specifically in <tt>split()</tt> in AS3 and only when used with a string and not a regular expression. Of course this is somewhat obvious as <tt>replace()</tt> only replaces the first occurance of a string unless a regex with <tt>'g'</tt> is used.</p>
<p>Further testing revealed an interesting anomaly if my replacement text used a different character than the text I was searching for:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;abbbbc&quot;</span>.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;bbb&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">join</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;zz&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;abbbc&quot;</span>.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;bb&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">join</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;z&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;abbbbbc&quot;</span>.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;bbbb&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">join</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;zzz&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>In AS2 this outputs:</p>
<pre>azzbc
azbc
azzzbc</pre>
<p>leaving the last <tt>'b'</tt> untouched, as we would expect; but in AS3:</p>
<pre>azzzzc
azzc
azzzzzzc</pre>
<p>&#8230;.where did all of the <tt>'b'</tt>s go?</p>
<p>The more algorithmic among you (wait, is anyone actually reading this?) will have figured it out by now but a look at the output of <tt>split()</tt> makes this much more obvious. If you run:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;abbbbc&quot;</span>.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;bbb&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;abbbc&quot;</span>.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;bb&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;abbbbbc&quot;</span>.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;bbbb&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>you get this in AS2:</p>
<pre>a,bc
a,bc
a,bc</pre>
<p>and this in AS3:</p>
<pre>a,,c
a,,c
a,,c</pre>
<p>The arrays are the same for all 3 runs but the interesting part is that in AS3 all traces of <tt>'b'</tt> disappear and we get an empty string in between the &#8220;bookend&#8221; <tt>'a'</tt> and <tt>'b'</tt>. From this output we can deduce that AS3 is finding 2 copies of the search string as the resulting array is 3 elements long; vs. AS2&#8242;s 2 element array showing that it is finding 1 match. Logically, and from a brain teaser perspective, there are actually 2 &#8220;matches&#8221; for <tt>"bbb"</tt> in the string <tt>"abbbbc"</tt>. There&#8217;s the first 3 <tt>'b'</tt>s and the last 3 <tt>'b'</tt>s. This isn&#8217;t how we were expecting <tt>split()</tt> to function, though, as the semantics of <tt>split()</tt> are supposed to be such that if you do a <tt>split()</tt> followed by a <tt>join()</tt> with the same string you should get the same string back again. In the case of AS3 <tt>"abbbc".split("bb").join("bb")</tt> will actually increase the length of the string by one <tt>'b'</tt>.</p>
<p>Another simple test shows that the same thing happens with a multicharacter repeating pattern:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;a-_-_-_-_d&quot;</span>.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;-_-_-_&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">join</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;-_-_&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>A little cogitation reveals how this could happen given a simple splitting algorithm. Here&#8217;s some AS code which exhibits the same problem as AS3&#8242;s <tt>String.split()</tt>:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> brokenSplit<span style="color: #66cc66;">&#40;</span>str : <span style="color: #0066CC;">String</span>, needle : <span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">Array</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> output : <span style="color: #0066CC;">Array</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Array</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> lastFound : <span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">0</span>;
	<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i : <span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&amp;</span>lt; str.<span style="color: #0066CC;">length</span>; ++i<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>str.<span style="color: #0066CC;">substr</span><span style="color: #66cc66;">&#40;</span>i, needle.<span style="color: #0066CC;">length</span><span style="color: #66cc66;">&#41;</span> == needle<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			output.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>str.<span style="color: #0066CC;">substr</span><span style="color: #66cc66;">&#40;</span>lastFound, i - lastFound<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
			lastFound = i + needle.<span style="color: #0066CC;">length</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>lastFound <span style="color: #66cc66;">&amp;</span>lt; i<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		output.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>str.<span style="color: #0066CC;">substr</span><span style="color: #66cc66;">&#40;</span>lastFound, i<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
	<span style="color: #b1b100;">return</span> output;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>and here is the same code with only 3 characters added which outputs the same as AS2&#8242;s <tt>String.split()</tt>:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> fixedSplit<span style="color: #66cc66;">&#40;</span>str : <span style="color: #0066CC;">String</span>, needle : <span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">Array</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> output : <span style="color: #0066CC;">Array</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Array</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> lastFound : <span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">0</span>;
	<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i : <span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&amp;</span>lt; str.<span style="color: #0066CC;">length</span>; ++i<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>str.<span style="color: #0066CC;">substr</span><span style="color: #66cc66;">&#40;</span>i, needle.<span style="color: #0066CC;">length</span><span style="color: #66cc66;">&#41;</span> == needle<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			output.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>str.<span style="color: #0066CC;">substr</span><span style="color: #66cc66;">&#40;</span>lastFound, i - lastFound<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
			lastFound = <span style="color: #66cc66;">&#40;</span>i += needle.<span style="color: #0066CC;">length</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>lastFound <span style="color: #66cc66;">&amp;</span>lt; i<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		output.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>str.<span style="color: #0066CC;">substr</span><span style="color: #66cc66;">&#40;</span>lastFound, i<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
	<span style="color: #b1b100;">return</span> output;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>The only difference between the two is that fixedSplit() increments the iterator (<tt>i</tt>) by the length of the needle when a match is found. <tt>brokenSplit()</tt> naively keeps looking for a match on the very next character even though it is inside a match.</p>
<p>Here is a swf running the various test cases in AS2:<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_AS2_650904977"
			class="flashmovie"
			width="430"
			height="500">
	<param name="movie" value="/flash/as_split/AS2.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/flash/as_split/AS2.swf"
			name="fm_AS2_650904977"
			width="430"
			height="500">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Here is a swf running the various test cases in AS3:<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_AS3_1575088638"
			class="flashmovie"
			width="430"
			height="500">
	<param name="movie" value="/flash/as_split/AS3.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/flash/as_split/AS3.swf"
			name="fm_AS3_1575088638"
			width="430"
			height="500">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>I&#8217;ve tested in Flash versions: 9,0,28,0 (debug player for Flex Builder 2), 9,0,47,0 (current release player as of this post), 9,0,60,235 (debug player for Flex Builder 3 beta 2), and 9,0,98,0 (MovieStar). The same output displays in all 3 versions.</p>
<p>I have opened a bug report in Adobe&#8217;s bug system: <a href="http://bugs.adobe.com/jira/browse/ASC-2936">ASC-2936</a>.</p>
<p>UPDATE: fixed the swf links so you should be able to see the tests working again.<br />
UPDATE: My bug was marked a duplicate of <a href="http://bugs.adobe.com/jira/browse/ASC-1739">ASC-1739</a>, which is slated to be fixed in Flash Player 9.1. I&#8217;m glad that others found this issue too.<br />
UPDATE: The bug is fixed in Flash Player 10,0,12,36. It was probably fixed in an earlier version of player 9, but I&#8217;m not sure. Regardless, it is better to use the function meant for a specific use instead of a hack.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reversefold.com/blog/2007/11/07/as3-can-solve-more-brain-teasers-than-as2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
