<?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>Displayobject &#187; Flash</title>
	<atom:link href="http://www.displayobject.fr/category/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.displayobject.fr</link>
	<description>Back to the display list</description>
	<lastBuildDate>Mon, 09 Jan 2012 13:26:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>TapDoctor 1 is out on iOS, Android and BlackBerry</title>
		<link>http://www.displayobject.fr/2011/08/31/tapdoctor-1-is-out-android-ios-and-blackberry/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tapdoctor-1-is-out-android-ios-and-blackberry</link>
		<comments>http://www.displayobject.fr/2011/08/31/tapdoctor-1-is-out-android-ios-and-blackberry/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 16:25:56 +0000</pubDate>
		<dc:creator>jonas</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[IOS]]></category>

		<guid isPermaLink="false">http://www.displayobject.fr/?p=765</guid>
		<description><![CDATA[Help TapDoctor to beat the viruses that have escaped from his laboratory. They are very bad but when they are more than two they are not able to agree. Tap where you have to join and exterminate them.TapDoctor for iPhone &#8230; <a href="http://www.displayobject.fr/2011/08/31/tapdoctor-1-is-out-android-ios-and-blackberry/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Help TapDoctor to beat the viruses that have escaped from his laboratory.<br />
They are very bad but when they are more than two they are not able to agree.<br />
Tap where you have to join and exterminate them.<span id="more-765"></span><br/><br/><strong><a href="http://www.displayobject.fr/wp-content/uploads/2011/08/icon512.png"><img title="icon512" src="http://www.displayobject.fr/wp-content/uploads/2011/08/icon512-150x150.png" alt="" width="150" height="150" align="left" /></a>TapDoctor for iPhone</strong><br />
<a href="http://itunes.apple.com/us/app/tapdoctor/id443408509">http://itunes.apple.com/us/app/tapdoctor/id443408509</a></p>
<p><strong>TapDoctor for Android</strong><br />
<a href="https://market.android.com/details?id=air.com.jonas.TapDoctor">https://market.android.com/details?id=air.com.jonas.TapDoctor</a></p>
<p><strong>TapDoctor for Blackberry Playbook</strong><br />
<a href="https://appworld.blackberry.com/webstore/content/55119">https://appworld.blackberry.com/webstore/content/55119</a><br />
<br/><br/><br />
TapDoctor is a puzzle game that combines observation, reflection and speed.<br />
Have fun!</p>
<p>This is version 1.<br />
To be continued&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.displayobject.fr/2011/08/31/tapdoctor-1-is-out-android-ios-and-blackberry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Performance test class for AS3 Mobile dev</title>
		<link>http://www.displayobject.fr/2011/07/06/a-performance-test-class-for-as3-mobile-dev/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-performance-test-class-for-as3-mobile-dev</link>
		<comments>http://www.displayobject.fr/2011/07/06/a-performance-test-class-for-as3-mobile-dev/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 19:49:12 +0000</pubDate>
		<dc:creator>jonas</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[IOS]]></category>

		<guid isPermaLink="false">http://www.displayobject.fr/?p=660</guid>
		<description><![CDATA[I currently need to do some bench to optimize my iPhone game. (TapDoctor ) So I&#8217;m working on a simple class to facilitate the work, inspired by the Grant Skinner performance test, but with the mobile constraint : be as &#8230; <a href="http://www.displayobject.fr/2011/07/06/a-performance-test-class-for-as3-mobile-dev/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I currently need to do some bench to optimize my iPhone game. (TapDoctor <img src='http://www.displayobject.fr/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )<br />
So I&#8217;m working on a simple class to facilitate the work, inspired by the <a href="http://gskinner.com/blog/archives/2010/02/performancetest.html" target="_blank">Grant Skinner performance test</a>, but with the mobile constraint : be as light as possible.<br />
<span id="more-660"></span><br />
<a href="https://github.com/jonasmonnier/Mobilo/tree/master/src/com/mobilo/bench" target="_blank">Bench class on github</a></p>
<p><strong>Use : </strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">Bench.<span style="color: #006600;">output</span> = output;
&nbsp;
Bench.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>test1, <span style="color: #ff0000;">&quot;This is the 1st test with 5 iterations&quot;</span>, <span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#41;</span>;
Bench.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>test2, <span style="color: #ff0000;">&quot;This is the 2nd test with 5 iterations&quot;</span>, <span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
Bench.<span style="color: #006600;">run</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> test1<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">// here what I want to bench</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> test2<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">// here what I want to bench</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> output<span style="color: #66cc66;">&#40;</span>result : <span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">//see https://github.com/jonasmonnier/Mobilo/blob/master/src/com/mobilo/bench/BenchView.as</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>I took the loops from grant skinner to make my first test. </p>
<p><a href="https://github.com/jonasmonnier/Mobilo/blob/master/src/bench/Loops.as" target="_blank">Loop test class on Github</a></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> forIncrement<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i : uint = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&lt;</span> loops; i++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> a : uint = i;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> forDecrement<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i : uint = loops; i <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">0</span>; i--<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> a : uint = i - <span style="color: #cc66cc;">1</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> whileIncrement<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> i : uint = <span style="color: #cc66cc;">0</span>;
	<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>i <span style="color: #66cc66;">&lt;</span> loops<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> a : uint = i;
		i++;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> whileDecrement<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> i : uint = loops;
	<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>--i<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> a : uint = i;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> doWhileIncrement<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> i : uint = <span style="color: #cc66cc;">0</span>;
	<span style="color: #b1b100;">do</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> a : uint = i;
	<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>++i <span style="color: #66cc66;">&lt;</span> loops<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> doWhileDecrement<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> i : uint = loops - <span style="color: #cc66cc;">1</span>;
	<span style="color: #b1b100;">do</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> a : uint = i;
	<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>i--<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> forIn<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> b:<span style="color: #66cc66;">*</span> <span style="color: #b1b100;">in</span> vec<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> a : uint = b;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> forEachIn<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">for</span> <span style="color: #b1b100;">each</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> b:<span style="color: #0066CC;">Boolean</span> <span style="color: #b1b100;">in</span> vec<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> a : uint = loops;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> forEachInUntyped<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">for</span> <span style="color: #b1b100;">each</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> b:<span style="color: #66cc66;">*</span> <span style="color: #b1b100;">in</span> vec<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> a : uint = loops;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> forEachInPosttyped<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">for</span> <span style="color: #b1b100;">each</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> b:<span style="color: #66cc66;">*</span> <span style="color: #b1b100;">in</span> vec<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> c : <span style="color: #0066CC;">Boolean</span> = b as <span style="color: #0066CC;">Boolean</span>;
		<span style="color: #000000; font-weight: bold;">var</span> a : uint = loops;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> vecForEach<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	vec.<span style="color: #b1b100;">forEach</span><span style="color: #66cc66;">&#40;</span>vecForEachF<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// helper functions:</span>
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> vecForEachF<span style="color: #66cc66;">&#40;</span>item : <span style="color: #0066CC;">Boolean</span>, <span style="color: #0066CC;">index</span> : <span style="color: #0066CC;">int</span>, vec : Vector.<span style="color: #66cc66;">&lt;</span>Boolean<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> a : uint = <span style="color: #0066CC;">index</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>I test 1 million loops 5 times with a 1 second delay between each test.<br />
Some results are a bit surprising&#8230;</p>
<table border="0">
<tbody>
<tr>
<th>Your flash player (wait 60s) > scrollable</th>
<th>AIR IOS 2.7 on my 3GS</th>
</tr>
<tr>
<td valign="top">
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_0" width="320" height="480">
      <param name="movie" value="http://www.displayobject.fr/projects/as3-mobilo/bench/Loops.swf" />
      <param name="allowfullscreen" value="true" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://www.displayobject.fr/projects/as3-mobilo/bench/Loops.swf" width="320" height="480" allowfullscreen="true">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
</td>
<td><span style="font-family:Times New Roman; font-size: 12px;">forIncrement<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=0 ms [memory total=5.701 private=7.874 free=0.250]<br />
time=0 ms [memory total=5.596 private=7.874 free=0.356]<br />
time=0 ms [memory total=5.576 private=7.874 free=0.375]<br />
time=0 ms [memory total=5.572 private=7.854 free=0.379]<br />
time=0 ms [memory total=5.572 private=7.854 free=0.379]<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=0 max=0 min=0 deviation=NaN&nbsp;</p>
<p>forDecrement<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=0 ms [memory total=5.576 private=7.854 free=0.375]<br />
time=0 ms [memory total=5.572 private=7.854 free=0.379]<br />
time=0 ms [memory total=5.572 private=7.854 free=0.379]<br />
time=0 ms [memory total=5.572 private=7.854 free=0.379]<br />
time=0 ms [memory total=5.572 private=7.854 free=0.379]<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=0 max=0 min=0 deviation=NaN</p>
<p>whileIncrement<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=0 ms [memory total=5.576 private=7.854 free=0.375]<br />
time=0 ms [memory total=5.572 private=7.854 free=0.379]<br />
time=0 ms [memory total=5.568 private=7.854 free=0.383]<br />
time=0 ms [memory total=5.568 private=7.854 free=0.383]<br />
time=0 ms [memory total=5.568 private=7.854 free=0.383]<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=0 max=0 min=0 deviation=NaN</p>
<p>whileDecrement<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=302 ms [memory total=5.568 private=7.854 free=0.383]<br />
time=290 ms [memory total=5.564 private=7.854 free=0.387]<br />
time=290 ms [memory total=5.564 private=7.854 free=0.387]<br />
time=295 ms [memory total=5.564 private=7.854 free=0.387]<br />
time=291 ms [memory total=5.564 private=7.854 free=0.387]<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=294 max=302 min=290 deviation=0.041</p>
<p>doWhileIncrement<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=83 ms [memory total=5.568 private=7.854 free=0.383]<br />
time=83 ms [memory total=5.564 private=7.854 free=0.387]<br />
time=83 ms [memory total=5.560 private=7.854 free=0.391]<br />
time=83 ms [memory total=5.553 private=7.858 free=0.399]<br />
time=83 ms [memory total=5.553 private=7.858 free=0.399]<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=83 max=83 min=83 deviation=0.000</p>
<p>doWhileDecrement<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=267 ms [memory total=5.557 private=7.858 free=0.395]<br />
time=267 ms [memory total=5.553 private=7.858 free=0.399]<br />
time=266 ms [memory total=5.553 private=7.858 free=0.399]<br />
time=266 ms [memory total=5.553 private=7.858 free=0.399]<br />
time=267 ms [memory total=5.553 private=7.858 free=0.399]<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=267 max=267 min=266 deviation=0.004</p>
<p>forIn<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=398 ms [memory total=5.557 private=7.858 free=0.395]<br />
time=396 ms [memory total=5.553 private=7.858 free=0.399]<br />
time=407 ms [memory total=5.553 private=7.858 free=0.399]<br />
time=396 ms [memory total=5.553 private=7.858 free=0.399]<br />
time=396 ms [memory total=5.553 private=7.862 free=0.399]<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=399 max=407 min=396 deviation=0.028</p>
<p>forEachIn<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=398 ms [memory total=5.557 private=7.862 free=0.395]<br />
time=398 ms [memory total=5.549 private=7.862 free=0.402]<br />
time=398 ms [memory total=5.549 private=7.862 free=0.402]<br />
time=398 ms [memory total=5.549 private=7.862 free=0.402]<br />
time=398 ms [memory total=5.553 private=7.862 free=0.399]<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=398 max=398 min=398 deviation=0.000</p>
<p>forEachInUntyped<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=398 ms [memory total=5.557 private=7.862 free=0.395]<br />
time=397 ms [memory total=5.553 private=7.862 free=0.399]<br />
time=398 ms [memory total=5.553 private=7.862 free=0.399]<br />
time=436 ms [memory total=5.553 private=7.862 free=0.399]<br />
time=406 ms [memory total=5.553 private=7.866 free=0.399]<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=407 max=436 min=397 deviation=0.096</p>
<p>forEachInPosttyped<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=436 ms [memory total=5.564 private=7.866 free=0.387]<br />
time=437 ms [memory total=5.560 private=7.866 free=0.391]<br />
time=446 ms [memory total=5.557 private=7.866 free=0.395]<br />
time=443 ms [memory total=5.557 private=7.874 free=0.395]<br />
time=436 ms [memory total=5.557 private=7.874 free=0.395]<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=440 max=446 min=436 deviation=0.023</p>
<p>vecForEach<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=2400 ms [memory total=5.623 private=7.878 free=0.328]<br />
time=2410 ms [memory total=5.619 private=7.870 free=0.332]<br />
time=2411 ms [memory total=5.619 private=7.870 free=0.332]<br />
time=2392 ms [memory total=5.619 private=7.870 free=0.332]<br />
time=2406 ms [memory total=5.619 private=7.870 free=0.332]<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=2404 max=2411 min=2392 deviation=0.008</p>
<p>forIncrement<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=0 ms [memory total=5.623 private=7.870 free=0.328]<br />
time=0 ms [memory total=5.619 private=7.870 free=0.332]<br />
time=0 ms [memory total=5.619 private=7.870 free=0.332]<br />
time=0 ms [memory total=5.619 private=7.870 free=0.332]<br />
time=0 ms [memory total=5.619 private=7.870 free=0.332]<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
time=0 max=0 min=0 deviation=NaN<br />
</span></td>
</tr>
</tbody>
</table>
<p>Note that Garbage Collection is not forced ​​with Flash Player in this version.</p>
<p>More info in an upcoming post&#8230;</p>
<p>Nobody to point out my spelling mistakes ?<br />
Hope it is understandable <img src='http://www.displayobject.fr/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.displayobject.fr/2011/07/06/a-performance-test-class-for-as3-mobile-dev/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Time management for as3 mobile dev &#8211; Tick, Timeout and Interval</title>
		<link>http://www.displayobject.fr/2011/07/06/time-management-for-as3-mobile-dev-tick-timeout-and-interval/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=time-management-for-as3-mobile-dev-tick-timeout-and-interval</link>
		<comments>http://www.displayobject.fr/2011/07/06/time-management-for-as3-mobile-dev-tick-timeout-and-interval/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 11:06:19 +0000</pubDate>
		<dc:creator>jonas</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[IOS]]></category>

		<guid isPermaLink="false">http://www.displayobject.fr/?p=627</guid>
		<description><![CDATA[While working on my iPhone game project I realized that AIR 2.7 for IOS introduced bug with the Timer class and setTimeout. So I wrote 3 static classes : Tick, Timeout, Interval class to bypass the problem. (With a big &#8230; <a href="http://www.displayobject.fr/2011/07/06/time-management-for-as3-mobile-dev-tick-timeout-and-interval/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>While working on my iPhone  game project I realized that AIR 2.7 for IOS introduced <a href="https://bugbase.adobe.com/index.cfm?event=bug&#038;id=2904026" target="_blank">bug with the Timer class</a> and setTimeout.</p>
<p>So I wrote 3 static classes : Tick, Timeout, Interval class to bypass the problem. (With a big thx to <a href="https://twitter.com/#!/seraf_NSS" target="_blank">@seraf_NSS</a> for test, debug and enhancements)<br />
<span id="more-627"></span><br />
To be simple Tick is a global ENTER_FRAME available from anywhere (including non-DisplayObject).<br />
Then Timeout and Interval subscribes to when necessary.</p>
<p>To be optimized for mobile, all listeners are stored in vectors and no events are dispatched.</p>
<p><strong>Tick use :</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// create a tick</span>
Tick.<span style="color: #006600;">create</span><span style="color: #66cc66;">&#40;</span>onTick<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// remove a tick</span>
Tick.<span style="color: #006600;">remove</span><span style="color: #66cc66;">&#40;</span>onTick<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> onTick<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;tick&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><a href="https://github.com/jonasmonnier/Mobilo/blob/master/src/com/mobilo/time/Tick.as" target="_blank">Tick class</a><br />
<a href="https://github.com/jonasmonnier/Mobilo/blob/master/src/demo/TickDemo.as" target="_blank">Tick demo class</a></p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_1" width="321" height="480">
      <param name="movie" value="http://www.displayobject.fr/projects/as3-mobilo/TickDemo.swf" />
      <param name="allowfullscreen" value="true" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://www.displayobject.fr/projects/as3-mobilo/TickDemo.swf" width="321" height="480" allowfullscreen="true">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<p><strong>Timeout use :</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">&nbsp;
<span style="color: #808080; font-style: italic;">// create a timeout with a 300 ms delay</span>
<span style="color: #000000; font-weight: bold;">var</span> id1:<span style="color: #0066CC;">int</span> = Timeout.<span style="color: #006600;">create</span><span style="color: #66cc66;">&#40;</span>onTimeout1, <span style="color: #cc66cc;">300</span>, <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// create a timeout with a 300 ms delay and 1 optionnal argument</span>
<span style="color: #000000; font-weight: bold;">var</span> id2:<span style="color: #0066CC;">int</span> = Timeout.<span style="color: #006600;">create</span><span style="color: #66cc66;">&#40;</span>onTimeout2, <span style="color: #cc66cc;">300</span>, <span style="color: #ff0000;">&quot;hello&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// clear a timeout</span>
Timeout.<span style="color: #0066CC;">clear</span><span style="color: #66cc66;">&#40;</span>id1<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> onTimeout1<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;onTimeout1&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> onTimeout2<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">message</span>:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;onTimeout2&quot;</span>, <span style="color: #0066CC;">message</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><a href="https://github.com/jonasmonnier/Mobilo/blob/master/src/com/mobilo/time/Timout.as" target="_blank">Timout class</a><br />
<a href="https://github.com/jonasmonnier/Mobilo/blob/master/src/demo/TimoutDemo.as" target="_blank">Timout demo class</a></p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_2" width="320" height="480">
      <param name="movie" value="http://www.displayobject.fr/projects/as3-mobilo/TimeoutDemo.swf" />
      <param name="allowfullscreen" value="true" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://www.displayobject.fr/projects/as3-mobilo/TimeoutDemo.swf" width="320" height="480" allowfullscreen="true">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<p><strong>Interval use :</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">&nbsp;
<span style="color: #808080; font-style: italic;">// create a interval with a 300 ms delay repeated 10 times </span>
<span style="color: #000000; font-weight: bold;">var</span> id1:<span style="color: #0066CC;">int</span> = Interval.<span style="color: #006600;">create</span><span style="color: #66cc66;">&#40;</span>onInterval1, <span style="color: #cc66cc;">300</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// create a timeout with a 300 ms delay repeated until we stop + 1 optionnal argument</span>
<span style="color: #000000; font-weight: bold;">var</span> id2:<span style="color: #0066CC;">int</span> = Interval.<span style="color: #006600;">create</span><span style="color: #66cc66;">&#40;</span>onInterval2, <span style="color: #cc66cc;">300</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #ff0000;">&quot;hello&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// clear an interval</span>
Interval.<span style="color: #0066CC;">clear</span><span style="color: #66cc66;">&#40;</span>id1<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> onInterval1<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;onInterval1&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> onInterval2<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">message</span>:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;onInterval2&quot;</span>, <span style="color: #0066CC;">message</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><a href="https://github.com/jonasmonnier/Mobilo/blob/master/src/com/mobilo/time/Interval.as" target="_blank">Interval class</a><br />
<a href="https://github.com/jonasmonnier/Mobilo/blob/master/src/demo/IntervalDemo.as" target="_blank">Interval demo class</a></p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_3" width="320" height="480">
      <param name="movie" value="http://www.displayobject.fr/projects/as3-mobilo/IntervalDemo.swf" />
      <param name="allowfullscreen" value="true" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://www.displayobject.fr/projects/as3-mobilo/IntervalDemo.swf" width="320" height="480" allowfullscreen="true">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<p>I am interested in your feedback on these classes and this article. Please point out my spelling mistakes, I think I&#8217;m better in Actionscript than in English&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.displayobject.fr/2011/07/06/time-management-for-as3-mobile-dev-tick-timeout-and-interval/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Timeout class to replace setTimeout in AIR 2.7 for IOS</title>
		<link>http://www.displayobject.fr/2011/06/16/a-timeout-class-to-replace-settimeout-in-air-2-7-for-ios/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-timeout-class-to-replace-settimeout-in-air-2-7-for-ios</link>
		<comments>http://www.displayobject.fr/2011/06/16/a-timeout-class-to-replace-settimeout-in-air-2-7-for-ios/#comments</comments>
		<pubDate>Thu, 16 Jun 2011 12:32:13 +0000</pubDate>
		<dc:creator>jonas</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[IOS]]></category>
		<category><![CDATA[AIR2.7]]></category>
		<category><![CDATA[setTimeout]]></category>
		<category><![CDATA[timeout]]></category>

		<guid isPermaLink="false">http://www.displayobject.fr/?p=602</guid>
		<description><![CDATA[After a first compilation of my AIR for IOS app with AIR 2.7 the situation was not good. The application that was developed and optimized for AIR 2.6 was not smooth at all A few tests later, I isolated the &#8230; <a href="http://www.displayobject.fr/2011/06/16/a-timeout-class-to-replace-settimeout-in-air-2-7-for-ios/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After a first compilation of my AIR for IOS app with AIR 2.7 the situation was not good.<br />
The application that was developed and optimized for AIR 2.6 was not smooth at all <img src='http://www.displayobject.fr/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p><strong>A few tests later, I isolated the problem: The setTimout() method does not work properly (?) in AIR 2.7 for IOS.<br />
</strong><br />
<span id="more-602"></span><br />
<a href="https://github.com/jonasmonnier/Mobilo/blob/master/src/com/mobilo/time/Timeout.as" target="_blank">I solved the problem by coding a small static class to manage multiple timeout</a> using an unique enterFrame event.</p>
<p>Thx to <a href="https://twitter.com/seraf_NSS">Seraf</a> for bug fix and clear(id) method <img src='http://www.displayobject.fr/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Use :</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">Timeout.<span style="color: #006600;">create</span><span style="color: #66cc66;">&#40;</span>myMethod, <span style="color: #cc66cc;">300</span>, <span style="color: #ff0000;">&quot;optional param&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Below are screenshots of the <strong>setTimeout() VS my Timeout.execute()</strong> test on my iPhone 3GS.</p>
<p><img src="http://www.displayobject.fr/labs/flash/timeout/post/AIR-IOS-timeout.png" alt="AIR 2.6 VS AIR 2.7" /></p>
<p><strong>Below the test for FP 10.1. </strong><br />
Note that my class performs better or equal to the setTimeout() method (Win7 &#8211; FF4 &#8211; FP 11).</p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_4" width="320" height="480">
      <param name="movie" value="http://www.displayobject.fr/labs/flash/timeout/TimeoutTest.swf" />
      <param name="allowfullscreen" value="true" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://www.displayobject.fr/labs/flash/timeout/TimeoutTest.swf" width="320" height="480" allowfullscreen="true">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<p><a href="https://github.com/jonasmonnier/Mobilo/blob/master/src/test/TimeoutTest.as" target="_blank">Test class source</a><br />
<a href="https://github.com/jonasmonnier/Mobilo/blob/master/src/com/mobilo/time/Timeout.as" target="_blank">Timeout class source</a></p>
<p>&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.displayobject.fr/2011/06/16/a-timeout-class-to-replace-settimeout-in-air-2-7-for-ios/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>AS3 Error Manager with UncaughtErrorEvent &#8211; ErrorHandler 0.2</title>
		<link>http://www.displayobject.fr/2011/06/02/as3-error-manager-with-uncaughterrorevent-error-handler-0-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=as3-error-manager-with-uncaughterrorevent-error-handler-0-2</link>
		<comments>http://www.displayobject.fr/2011/06/02/as3-error-manager-with-uncaughterrorevent-error-handler-0-2/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 23:03:05 +0000</pubDate>
		<dc:creator>jonas</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[ErrorHandler]]></category>
		<category><![CDATA[UncaughtErrorEvent]]></category>

		<guid isPermaLink="false">http://www.displayobject.fr/?p=573</guid>
		<description><![CDATA[Some modification on my ErrorHandler class &#8211; sources. You can now view and navigate through all the errors You can save a log file wich contain all information available in the Capabilities class. The class is now a singleton to &#8230; <a href="http://www.displayobject.fr/2011/06/02/as3-error-manager-with-uncaughterrorevent-error-handler-0-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Some modification on my ErrorHandler class &#8211; <a href="https://github.com/jonasmonnier/jonAS3" target="_blank">sources</a>.</p>
<li>You can now view and navigate through all the errors</li>
<li>You can save a log file wich contain all information available in the Capabilities class.</li>
<li>The class is now a singleton to initialize the error handler in loaded swf (future version).</li>
<p><span id="more-573"></span></p>
<p><strong>Use :</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">ErrorHandler.<span style="color: #006600;">getIntance</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">init</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><strong>A reasonable adjustment in production :</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">ErrorHandler.<span style="color: #006600;">getIntance</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">activeWithPlayerMode</span> = ErrorHandler.<span style="color: #006600;">MODE_DEBUG</span>;</pre></div></div>


    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_5" width="650" height="460">
      <param name="movie" value="http://www.displayobject.fr/projects/as3-error-handler/0.2/ErrorHandlerTest.swf" />
      <param name="allowfullscreen" value="true" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://www.displayobject.fr/projects/as3-error-handler/0.2/ErrorHandlerTest.swf" width="650" height="460" allowfullscreen="true">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

]]></content:encoded>
			<wfw:commentRss>http://www.displayobject.fr/2011/06/02/as3-error-manager-with-uncaughterrorevent-error-handler-0-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3 Error Manager with UncaughtErrorEvent</title>
		<link>http://www.displayobject.fr/2011/05/24/as3-error-manager-with-uncaughterrorevent/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=as3-error-manager-with-uncaughterrorevent</link>
		<comments>http://www.displayobject.fr/2011/05/24/as3-error-manager-with-uncaughterrorevent/#comments</comments>
		<pubDate>Tue, 24 May 2011 20:22:29 +0000</pubDate>
		<dc:creator>jonas</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[global]]></category>
		<category><![CDATA[handler]]></category>
		<category><![CDATA[UncaughtErrorEvent]]></category>

		<guid isPermaLink="false">http://www.displayobject.fr/?p=555</guid>
		<description><![CDATA[This class has been updated -> ErrorHandler 0.2 With flash player 10.1 an UncaughtErrorEvent object is dispatched when an uncaught error occurs. Here is a small class for displaying errors within the application based on selected parameters &#8230; Sources on &#8230; <a href="http://www.displayobject.fr/2011/05/24/as3-error-manager-with-uncaughterrorevent/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This class has been updated -> <a href="http://www.displayobject.fr/2011/06/02/as3-errorhandler-0-2/">ErrorHandler 0.2</a></p>
<p>With flash player 10.1 an UncaughtErrorEvent object is dispatched when an uncaught error occurs.<br />
Here is a small class for displaying errors within the application based on selected parameters &#8230;<br />
<a href="https://github.com/jonasmonnier/jonAS3" target="_blank">Sources on Github</a><br />
<span id="more-555"></span></p>
<p><strong>Use :</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">error</span>:ErrorHandler = <span style="color: #000000; font-weight: bold;">new</span> ErrorHandler<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><strong>Demo :</strong></p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_6" width="650" height="460">
      <param name="movie" value="http://www.displayobject.fr/projects/as3-error-handler/0.1/ErrorHandlerTest.swf" />
      <param name="allowfullscreen" value="true" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://www.displayobject.fr/projects/as3-error-handler/0.1/ErrorHandlerTest.swf" width="650" height="460" allowfullscreen="true">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

]]></content:encoded>
			<wfw:commentRss>http://www.displayobject.fr/2011/05/24/as3-error-manager-with-uncaughterrorevent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deform your friends face with warpalizer alpha</title>
		<link>http://www.displayobject.fr/2010/11/29/deform-your-friends-face-with-warpalizer-alpha/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=deform-your-friends-face-with-warpalizer-alpha</link>
		<comments>http://www.displayobject.fr/2010/11/29/deform-your-friends-face-with-warpalizer-alpha/#comments</comments>
		<pubDate>Mon, 29 Nov 2010 13:02:14 +0000</pubDate>
		<dc:creator>jonas</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.displayobject.fr/?p=545</guid>
		<description><![CDATA[Un petit post pour présenter un petit projet perso.
<a href="http://apps.facebook.com/warpalizer/">Warpalizer</a> est une appli facebook qui permet de déformer ses photos et celles de ses amis.  <a href="http://www.displayobject.fr/2010/11/29/deform-your-friends-face-with-warpalizer-alpha/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Un petit post pour présenter un petit projet perso.<br />
<a href="http://apps.facebook.com/warpalizer/">Warpalizer</a> est une appli facebook qui permet de déformer ses photos et celles de ses amis. Actuellement en version alpha, l&#8217;appli est destinée à évoluer&#8230;<br />
<br/><br />
<span id="more-545"></span><br />
<img src="http://www.displayobject.fr/wp-content/uploads/2010/11/warpalizer-screenshot.jpg"></p>
]]></content:encoded>
			<wfw:commentRss>http://www.displayobject.fr/2010/11/29/deform-your-friends-face-with-warpalizer-alpha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why flash is not dead</title>
		<link>http://www.displayobject.fr/2010/05/01/why-flash-is-not-dead/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=why-flash-is-not-dead</link>
		<comments>http://www.displayobject.fr/2010/05/01/why-flash-is-not-dead/#comments</comments>
		<pubDate>Sat, 01 May 2010 21:17:19 +0000</pubDate>
		<dc:creator>Jonas</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Html5]]></category>

		<guid isPermaLink="false">http://www.displayobject.fr/?p=468</guid>
		<description><![CDATA[I keep reading “Flash is dead” or “Flash is no use anymore”. Do they actually know what they’re talking about? Are they Flash experts, have they worked with real clients? I don’t think they do, are or have. How to &#8230; <a href="http://www.displayobject.fr/2010/05/01/why-flash-is-not-dead/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img title="flash" src="http://www.displayobject.fr/wp-content/uploads/2010/05/flash.png" alt="flash" width="161" height="157" align="left" />I keep reading “Flash is dead” or “Flash is no use anymore”. Do they actually know what they’re talking about? Are they Flash experts, have they worked with real clients? I don’t think they do, are or have. How to bury the most innovative technology, which has inspired the current developments and uses of javascript, although it is currently the only way to offer a true rich web user experience.<br />
<span id="more-468"></span><br />
Last time I heard of a Flash Killer, it was for Silverlight, a technology with a penetration rate that still remains below <a href="http://riastats.com/">60%</a> several years after its release&#8230; Forget Silverlight then…. Forget…Html5. With a penetration rate below 20%, it might take years before it becomes equivalent to Flash’s, which is <a href="http://riastats.com/">near 100%</a> (Mobiles apart).  Let’s also keep in mind that the future release of IE9 supporting Html5 (correct support?) will not be available for users running Windows XP. Disappointing.</p>
<p>Picture Html5 full support in a few years. Let’s now picture Flash Player X, implemented with Adobe’s innovations, video, sound, 3D, performance, and anything that you can’t possibly imagine. Here you have the basic advantage of a plugin, a technology not depending on browsers and their updates, not depending on the current web actors’ inertia.</p>
<p>The non-support of Flash by Apple is a blow, but keep in mind that iPhone’s market share is declining. IPad is a great device, but unlike the iPhone (which has long walked solo on the market), it will soon face a fierce competition from manufacturers (<a href="http://www.engadget.com/2010/04/05/hp-slate-to-cost-549-have-1-6ghz-atom-z530-5-hour-battery/">HP Slate</a>, Toshiba, Dell&#8230;) developing tablets offering full-flash support.</p>
<p>More &amp; more  mobile devices will come with Android built on, and Google supports Adobe. The <a href="http://www.openscreenproject.org/" target="_blank">Open Screen Project</a> should allow Flash to be available on other OS.</p>
<p>It’s true that Flash is still not fully supported on Mobiles, but as things stand today, mobile web is not THE Web.</p>
<p>So I would appreciate people keeping in mind the reality of Web Development with real clients/users. Html5 will be a great evolution of html, but it’s still in development and far to be ready.</p>
<p>Fyi, I’m a Flash Developer and I’m booked up for months. <img src='http://www.displayobject.fr/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Thx @Nounie.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.displayobject.fr/2010/05/01/why-flash-is-not-dead/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Easy Fullscreen on a specific DisplayObject, deal with overlay and use hardware acceleration</title>
		<link>http://www.displayobject.fr/2010/04/29/fullscreen-on-a-specific-displayobject-overlay-and-hardware-acceleration/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fullscreen-on-a-specific-displayobject-overlay-and-hardware-acceleration</link>
		<comments>http://www.displayobject.fr/2010/04/29/fullscreen-on-a-specific-displayobject-overlay-and-hardware-acceleration/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 11:47:31 +0000</pubDate>
		<dc:creator>Jonas</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[acceleration]]></category>
		<category><![CDATA[DiplayObject]]></category>
		<category><![CDATA[Fullscreen]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[overlay]]></category>

		<guid isPermaLink="false">http://www.displayobject.fr/?p=420</guid>
		<description><![CDATA[There is several ways to show a specific zone/object in a Flash application in full-screen mode. The problems are to use hardware acceleration (interesting for video), to deal with possible overlay (display object above the target we want to show &#8230; <a href="http://www.displayobject.fr/2010/04/29/fullscreen-on-a-specific-displayobject-overlay-and-hardware-acceleration/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There is several ways to show a specific zone/object in a Flash application in full-screen mode. The problems are to use hardware acceleration (interesting for video), to deal with possible overlay (display object above the target we want to show in full-screen mode) or to avoid with UI pixelization. And we have to consider various player versions and hardwares&#8230;<br />
<span id="more-420"></span><br />
<span id="result_box"><span style="background-color: #ffffff;"><br />
With Flash Player 9, hardware acceleration is only possible using </span></span>fullScreenSourceRect.<br />
With a simple implementation we have 2 problems :</p>
<ul>
<li> Our target is scaled, so the bigger the the screen is (or the smaller our target is) the more our UI is pixelized.</li>
<li> The DisplayObjects above our target will be included in our full-screen.</li>
</ul>
<p>With Flash Player 10,  <span id="result_box"><span style="background-color: #ffffff;">hardware acceleration is possible </span></span>using direct or gpu mode, but it&#8217;s not available for AIR and depends on hardware&#8230;<br />
<a href="http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS2E9C7F3B-6A7C-4c5d-8ADD-5B23446FBEEB.html" target="_blank">Working with full-screen mode</a></p>
<p><span id="result_box"><span style="background-color: #ffffff;">The overlay can be managed during the application conception, but it can quickly become complicated and even impossible with a component that can be placed anywhere in an application</span></span>&#8230;</p>
<p>So I wrote a small class to simplify it (flash/flex).</p>
<p><strong>Example :</strong></p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_7" width="650" height="460">
      <param name="movie" value="http://www.displayobject.fr/projects/fullscreen/FullScreenTest.swf" />
      <param name="allowfullscreen" value="true" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://www.displayobject.fr/projects/fullscreen/FullScreenTest.swf" width="650" height="460" allowfullscreen="true">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<p><a href="http://www.displayobject.fr/projects/fullscreen/srcview/" target="_blank">Sources</a></p>
<p><strong>How does it works :</strong></p>
<p>Simple :</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> fullscreen:FullScreen = <span style="color: #000000; font-weight: bold;">new</span> FullScreen<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">target</span><span style="color: #66cc66;">&#41;</span>;
fullscreen.<span style="color: #006600;">mode</span> = FullScreen.<span style="color: #006600;">RESIZE_HARDWARE</span>;
fullscreen.<span style="color: #006600;">toggleFulScreen</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>In resize mode our target must be resizable (<a href="http://www.displayobject.fr/2010/04/06/simple-component-invalidation-in-as3/" target="_blank">Simple component invalidation</a>) :</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MyComp <span style="color: #0066CC;">extends</span> Sprite
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">_width</span>:<span style="color: #0066CC;">Number</span>;
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">_height</span>:<span style="color: #0066CC;">Number</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> MyComp<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
&nbsp;
	<span style="color: #66cc66;">&#125;</span>
	<span style="color: #0066CC;">public</span> override <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> <span style="color: #0066CC;">width</span><span style="color: #66cc66;">&#40;</span>value:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">_width</span> = value;
		_invalidate<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
	<span style="color: #0066CC;">public</span> override <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> <span style="color: #0066CC;">width</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">_width</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #0066CC;">public</span> override <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> <span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#40;</span>value:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">_height</span> = value;
		_invalidate<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
	<span style="color: #0066CC;">public</span> override <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> <span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">_height</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><strong>The 4 modes :</strong></p>
<p><strong>FullScreen.RESIZE</strong><br />
Resize the target to screen size and place it at the highest depth in the display list.</p>
<ul>
<li style="padding-bottom: 20px;"><strong>Benefits </strong>:<br />
Keep a clean UI.<br />
Resize your target as you want.</li>
<li style="padding-bottom: 40px;"><strong>Drawback </strong>:<br />
Worst for ressources.<br />
Do not use with video without gpu or direct mode.</li>
</ul>
<p><strong>FullScreen.RESIZE_HARDWARE</strong><br />
Resize the target at screen size and place it at the highest depth in the display list.<br />
Try hardware acceleration using fullScreenSourceRect on the full stage.</p>
<ul>
<li style="padding-bottom: 20px;"><strong>Benefits </strong>:<br />
Keep a clean UI.<br />
Resize your target as you want.<br />
<span id="result_box"><span style="background-color: #ffffff; color: #000000;">Use fewer resources</span></span> than FullScreen.RESIZE.</li>
<li style="padding-bottom: 40px;"><strong>Drawback </strong>:<br />
<span id="result_box"><span style="background-color: #ffffff; color: #000000;">Use more resources</span></span> than FullScreen.SCALE.</li>
</ul>
<p><strong><br />
FullScreen.SCALE</strong><br />
Scale with fullScreenSourceRect (try hardware acceleration).</p>
<ul>
<li style="padding-bottom: 20px;"><strong>Benefits </strong>:<br />
Best for ressources.<br />
No need to resize target.</li>
<li style="padding-bottom: 40px;"><strong>Drawback </strong>:<br />
UI pixelisation<br />
Potential overlays problems.</li>
</ul>
<p><strong>FullScreen.SCALE_ABOVE</strong><br />
Scale with fullScreenSourceRect (try hardware acceleration).<br />
Place target on highest depth.</p>
<ul>
<li style="padding-bottom: 20px;"><strong>Benefits </strong>:<br />
Best for ressources<br />
Avoid overlay<br />
No need to resize target</li>
<li style="padding-bottom: 40px;"><strong>Drawback </strong>:<br />
UI pixelisation</li>
</ul>
<p>Links :</p>
<p><a href="http://www.flashstreamworks.com/archive.php?post_id=1241799250" target="_blank">Flash fullscreen best practices</a></p>
<p><a href="http://www.displayobject.fr/projects/fullscreen/srcview/" target="_blank">Sources</a></p>
<p><span id="result_box"><span>I will soon release a 0.2 version. </span></span><span id="result_box"><span style="background-color: #ffffff; color: #000000;">All ideas are welcome.</span></span><br />
<span id="result_box"><span>Feel free to point out to me the mistakes</span></span><span id="result_box"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.displayobject.fr/2010/04/29/fullscreen-on-a-specific-displayobject-overlay-and-hardware-acceleration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple component invalidation in AS3</title>
		<link>http://www.displayobject.fr/2010/04/06/simple-component-invalidation-in-as3/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=simple-component-invalidation-in-as3</link>
		<comments>http://www.displayobject.fr/2010/04/06/simple-component-invalidation-in-as3/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 11:50:50 +0000</pubDate>
		<dc:creator>Jonas</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[invalidate]]></category>

		<guid isPermaLink="false">http://www.displayobject.fr/?p=396</guid>
		<description><![CDATA[When we develop components, it quickly becomes necessary not to update the display every time we change a parameter. The solution is to wait for the next enterFrame event to update the display. 
The UIComponent that is the base of Flash components offers all the methods to do this, but the last thing I want is to use them. <a href="http://www.displayobject.fr/2010/04/06/simple-component-invalidation-in-as3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When we develop components, it quickly becomes necessary not to update the display every time we change a parameter. </p>
<p>For example, this code calls three times my draw method :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">myComps.<span style="color: #0066CC;">width</span> = <span style="color: #cc66cc;">100</span>;
myComps.<span style="color: #0066CC;">height</span> = <span style="color: #cc66cc;">100</span>;
myComps.<span style="color: #0066CC;">color</span> = 0xFF0000;</pre></td></tr></table></div>

<p>Mmmm ? Stupid ?</p>
<p>The solution is to wait for the next enterFrame event to update the display.<br />
The UIComponent that is the base of Flash components offers <a href="http://www.adobe.com/devnet/flash/articles/creating_as3_components_pt6.html" target="_blank">all the methods to do this</a>, but the last thing I want is to use them.</p>
<p>Here&#8217;s how to set up a simple invalidation:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">package
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> InvalidateSprite <span style="color: #0066CC;">extends</span> Sprite 
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">_width</span>:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">150</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">_height</span>:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">100</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _color:<span style="color: #0066CC;">Number</span> = 0xCCCCCC;
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> InvalidateSprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
			_invalidate<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> override <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> <span style="color: #0066CC;">width</span><span style="color: #66cc66;">&#40;</span>value:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">_width</span> = value;
			_invalidate<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> override <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> <span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#40;</span>value:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">_height</span> = value;
			_invalidate<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> <span style="color: #0066CC;">color</span><span style="color: #66cc66;">&#40;</span>value:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			_color = value;
			_invalidate<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _draw<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			graphics.<span style="color: #0066CC;">clear</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			graphics.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span>_color, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
			graphics.<span style="color: #006600;">drawRect</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #0066CC;">_width</span>, <span style="color: #0066CC;">_height</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _invalidate<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span>hasEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
				addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, _invalidateCallback<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _invalidateCallback<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			removeEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, _invalidateCallback<span style="color: #66cc66;">&#41;</span>;
			_draw<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.displayobject.fr/2010/04/06/simple-component-invalidation-in-as3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

