<?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>Thinking in Code &#187; Flash Platform</title>
	<atom:link href="http://www.michelboudreau.com/tags/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.michelboudreau.com</link>
	<description>Michel Boudreau&#039;s Personal Blog</description>
	<lastBuildDate>Wed, 25 Apr 2012 20:18:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>EventDispatcher vs. Signals</title>
		<link>http://www.michelboudreau.com/2010/12/31/eventdispatcher-vs-signals/</link>
		<comments>http://www.michelboudreau.com/2010/12/31/eventdispatcher-vs-signals/#comments</comments>
		<pubDate>Fri, 31 Dec 2010 15:49:35 +0000</pubDate>
		<dc:creator>Michel Boudreau</dc:creator>
				<category><![CDATA[Flash Platform]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[as3signals]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[cons]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[eventdispatcher]]></category>
		<category><![CDATA[lab49]]></category>
		<category><![CDATA[pros]]></category>
		<category><![CDATA[signal]]></category>

		<guid isPermaLink="false">http://www.michelboudreau.com/?p=628</guid>
		<description><![CDATA[At our last Flex Meetup, Adam Spektor did an overview ...]]></description>
			<content:encoded><![CDATA[<p>At our last <a href="http://www.meetup.com/New-York-Flex-Meetup/" target="_blank">Flex Meetup</a>, Adam Spektor did an overview of <a href="https://github.com/robertpenner/as3-signals" target="_blank">AS3Signals</a> (by <a href="http://flashblog.robertpenner.com/" target="_blank">Robert Penner</a>) which brought up some interesting questions about why developers would use Signals over regular Events.  I decided that I would test it out and benchmark both methods, meanwhile evaluating the pros and cons of each.  To be able to test the results, I created a FlexUnit project that would test the creation and dispatch of one event, and then the dispatch of a thousand events.  In one test case, I would test a single Signal and in the other test case I would just create a central EventDispatcher to try to mimic Signals.  You can find the project <a href="http://www.michelboudreau.com/wp-content/uploads/2010/12/EventBenchmark.zip">here</a>, but the real important part is the execution time of each one.</p>
<p><span id="more-628"></span></p>
<p><strong>Results</strong></p>
<table class="datatable" style="border-collapse: collapse; width: 400px;">
<tbody>
<tr style="text-align: center;">
<td style="border-right: 3px solid white;"></td>
<td style="border-right: 3px solid white;" colspan="2"><strong>Event Dispatcher</strong></td>
<td colspan="2"><strong>Signals</strong></td>
</tr>
<tr style="text-align: center;">
<td style="border-right: 3px solid white;"></td>
<td>1 event</td>
<td style="border-right: 3px solid white;">1000 events</td>
<td>1 event</td>
<td>1000 events</td>
</tr>
<tr style="text-align: center;">
<td style="text-align: left; border-right: 3px solid white;"><strong>Trial 1</strong></td>
<td>26ms</td>
<td style="border-right: 3px solid white;">15ms</td>
<td>9ms</td>
<td>25ms</td>
</tr>
<tr style="text-align: center;">
<td style="text-align: left; border-right: 3px solid white;"><strong>Trial 2</strong></td>
<td>15ms</td>
<td style="border-right: 3px solid white;">55ms</td>
<td>11ms</td>
<td>20ms</td>
</tr>
<tr style="text-align: center;">
<td style="text-align: left; border-right: 3px solid white;"><strong>Trial 3</strong></td>
<td>47ms</td>
<td style="border-right: 3px solid white;">18ms</td>
<td>19ms</td>
<td>16ms</td>
</tr>
<tr style="text-align: center;">
<td style="text-align: left; border-right: 3px solid white;"><strong>Trial 4</strong></td>
<td>51ms</td>
<td style="border-right: 3px solid white;">15ms</td>
<td>15ms</td>
<td>25ms</td>
</tr>
<tr style="text-align: center;">
<td style="text-align: left; border-right: 3px solid white;"><strong>Average<br />
</strong></td>
<td><strong>34.75ms</strong></td>
<td style="border-right: 3px solid white;"><strong>25.75ms</strong></td>
<td><strong>13.5ms</strong></td>
<td><strong>21.5ms</strong></td>
</tr>
<tr>
<td style="border-right: 3px solid white;"><strong>Total</strong></td>
<td style="text-align: center; border-right: 3px solid white;" colspan="2"><strong>60.5ms</strong></td>
<td style="text-align: center;" colspan="2"><strong>35ms<br />
</strong></td>
</tr>
</tbody>
</table>
<p>Now, a few things about this data.  The Signals library was very consistent in the times outputted, however the EventDispatcher was very erratic.  You can see it a little here within the results, but these results were fairly tame.  During testing, I&#8217;ve seen spikes going both high and low.  I&#8217;ve also seen it several times being faster than Signals.  I&#8217;ve tried to find an explanation about why and all I could think of is because the EventDispatcher is so intertwined with Flash Player and that could affect the test somehow but this is all speculation.</p>
<p>Because of this inconsistency, it&#8217;s hard to interpret the data for the EventDispatcher, so instead let&#8217;s concentrate more on the Signals side.  You&#8217;ll notice that the time taken is fairly consistent and would work as expected (one event is faster than a thousand).  When I first heard of Signals, my first thought was that this would be faster than normal events, and the data clearly shows this by 173%.</p>
<p>Signals is fast, there&#8217;s no doubt about it, but will incorporating it in your project actually increase overall speed?  Will it actually benefit development?</p>
<p>Personally, I don&#8217;t think I would personally use it in my project for a few different reasons:</p>
<ol>
<li>It&#8217;s not native to Flash/Flex.  Some may dismiss this point, but when you have a whole system based upon EventDispatcher and Events, it&#8217;s hard to ignore.</li>
<li>Lack of bubbling and capture.  Signals is working on bubbling, but I doubt they will get it working as well as the native implementation.</li>
<li>There is no meta-data possible for Signals.  This severely limits the possibility of using signals in MXML.</li>
<li>Need to recreate all event variables for Signals all over again.  Signals tries to reduce boiler-plate code by dismissing custom Event classes, but you still need to create new variables in the class for the event which essentially cancel each other out.</li>
<li>Keeping two separate standards for events in one system is a maintenance nightmare.</li>
<li>Little speed gain for the amount of extra work needed to get it working in a system.</li>
</ol>
<p>All and all, I think Signals is a very good idea for performance and extra utility, however it seems to me that the concept is Utopian.  If we could swap out the native event mechanism of Flash, then I&#8217;d be all for it, but in my current situation it isn&#8217;t very realistic to replace a current system that works (very well I might add) with another that&#8217;s slightly faster and more convenient.  The pros simply do not outweigh the cons.  If I were to use Signals, it would be in a very small Actionscript only project.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michelboudreau.com/2010/12/31/eventdispatcher-vs-signals/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Parsley BYOL Workshop</title>
		<link>http://www.michelboudreau.com/2010/12/13/parsley-byol-workshop/</link>
		<comments>http://www.michelboudreau.com/2010/12/13/parsley-byol-workshop/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 03:23:50 +0000</pubDate>
		<dc:creator>Michel Boudreau</dc:creator>
				<category><![CDATA[Flash Platform]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Workshop]]></category>
		<category><![CDATA[byol]]></category>
		<category><![CDATA[lab49]]></category>
		<category><![CDATA[new york]]></category>
		<category><![CDATA[parsley]]></category>
		<category><![CDATA[workshop]]></category>

		<guid isPermaLink="false">http://www.michelboudreau.com/?p=625</guid>
		<description><![CDATA[A new application framework called Parsley is making waves in ...]]></description>
			<content:encoded><![CDATA[<p>A  new application framework called <a href="http://www.spicefactory.org/parsley/" target="_blank">Parsley</a> is making waves in the Flash/Flex community.  It&#8217;s being used to create some of the largest Flex applications known to man because of its malleability, ease of use and powerfulness.  And I&#8217;ll be leading a workshop on it.</p>
<p><a href="http://parsleyworkshop.eventbrite.com/" target="_blank">Sign up for the workshop</a> and come learn how to harness this tool for your next project.  BYOL means Bring Your Own Laptop as we will be constructing an application together by adding Parsley to the mix.  We will also <a href="http://www.ustream.tv/channel/mike-s-flex-channel" target="_blank">stream the whole workshop</a> online through UStream for those of you who cannot attend in person.</p>
<p>Please help spread the word.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michelboudreau.com/2010/12/13/parsley-byol-workshop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing Mike&#8217;s Flex Channel</title>
		<link>http://www.michelboudreau.com/2010/11/14/introducing-mikes-flex-channel/</link>
		<comments>http://www.michelboudreau.com/2010/11/14/introducing-mikes-flex-channel/#comments</comments>
		<pubDate>Sun, 14 Nov 2010 23:46:18 +0000</pubDate>
		<dc:creator>Michel Boudreau</dc:creator>
				<category><![CDATA[Mike's Flex Channel]]></category>
		<category><![CDATA[Flash Platform]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[lab49]]></category>

		<guid isPermaLink="false">http://www.michelboudreau.com/?p=588</guid>
		<description><![CDATA[One thing that&#8217;s bothered me over the months of creating ...]]></description>
			<content:encoded><![CDATA[<p>One thing that&#8217;s bothered me over the months of creating the New York Flex Meetup is that all the information given at these events are essentially &#8220;lost&#8221; since it isn&#8217;t recorded and saved.  With that, I&#8217;ve created a channel on UStream called <a href="http://www.ustream.tv/channel/mike-s-flex-channel" target="_blank">Mike&#8217;s Flex Channel</a>.  I&#8217;ll start posting more videos with these posts as tutorials.  Video introduction to the channel after the break.</p>
<p><span id="more-588"></span></p>
<div class="oembed oembed-video oembed-ustream-tv oembed-video-ustream-tv"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="296" id="utv608396" name="utv_n_236186"><param name="flashvars" value="loc=%2F&amp;autoplay=false&amp;vid=10866623&amp;locale=en_US" /><param name="wmode" value="opaque" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.ustream.tv/flash/viewer.swf" /><embed flashvars="loc=%2F&amp;autoplay=false&amp;vid=10866623&amp;locale=en_US" width="480" height="296" wmode="opaque" allowfullscreen="true" allowscriptaccess="always" id="utv608396" name="utv_n_236186" src="http://www.ustream.tv/flash/viewer.swf" type="application/x-shockwave-flash" /></object></div>
]]></content:encoded>
			<wfw:commentRss>http://www.michelboudreau.com/2010/11/14/introducing-mikes-flex-channel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe Max Post-Conference Thoughts</title>
		<link>http://www.michelboudreau.com/2010/11/04/adobe-max-post-conference-thoughts/</link>
		<comments>http://www.michelboudreau.com/2010/11/04/adobe-max-post-conference-thoughts/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 12:58:54 +0000</pubDate>
		<dc:creator>Michel Boudreau</dc:creator>
				<category><![CDATA[Adobe Max]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[career]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[developers]]></category>
		<category><![CDATA[devices]]></category>
		<category><![CDATA[Flash Platform]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[lab49]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[thoughts]]></category>
		<category><![CDATA[tv]]></category>

		<guid isPermaLink="false">http://www.michelboudreau.com/?p=574</guid>
		<description><![CDATA[If I were to describe Adobe Max 2010 in one ...]]></description>
			<content:encoded><![CDATA[<p>If I were to describe Adobe Max 2010 in one word, it would be this: <em>hopeful</em>.  The conference itself was a smash.  Adobe really know how to put on a show and please their community.  They know what we want and like because in a way, they are us.  But the conference isn&#8217;t what I was hopeful about, it&#8217;s the technology.  In these turbulent times of RIA development which really picked up over the years with Microsoft&#8217;s solution, Silverlight, and the recent push for HTML5, no one really knows who&#8217;s going to emerge victorious.</p>
<p><span id="more-574"></span>In my opinion, there is enough room for everyone unless one technology has all the pros, none of the cons.  Right now, it&#8217;s a pick and choose scenario.  If you want rich animations on a platform that has a very high market penetration, use Flash.  If you can control the user environment and want lots of power out of your app, go with Silverlight.  If you want a technology that can display on every device, go with Javascript (since HTML5 isn&#8217;t exactly available everywhere yet).</p>
<p>In spite of all this, there&#8217;s was a sense of uneasiness in my technology, which is Flash and Flex.  It seems that everyone else (Silverlight, HTML5) was innovating but Flash, which was the king of RIA, wasn&#8217;t doing the same.  I don&#8217;t mind learning new technologies, heck, it&#8217;s the reason I do software, but I like working with Flex.  Many of my coworkers say that a lot of the concepts behind RIA is transferable between technologies.  This is partially true, but the fact is that it took me 10 years to get to where I know the platform, the language and the frameworks in and out.  I don&#8217;t want to have to repeat the process of knowing another platform and everything associated with it even if it takes half that time.  Some say that&#8217;s a bad mentality to have, which can be true for some developers, but during the time that I&#8217;m learning a new technology, I&#8217;m not being as efficient, productive or creative as I&#8217;d like.</p>
<p>All of this is a thing of the past now.  That feeling went away when I was attending the conference.</p>
<p>Why?  Well, let&#8217;s see.  The team in charge of Flex seems to have grown considerably, they are finally coding the framework properly (spark), they are creating a better open source process where community members can submit patches, they now put in place a 6 month release schedule for Flex, they are rebuilding the compiler from scratch, they are listening very intently to the feedback of the developers and are innovating.  That&#8217;s only for Flex, the Flash player itself (the platform) is getting some major overhauls as well, like straight to GPU rendering (3D), threading and support for 3rd party controller (like an xbox controller, driving wheel or any other peripherals).</p>
<p>Furthermore, Adobe is really pushing the platform&#8217;s  multi-screen aspect (desktop, devices and TVs).  They&#8217;ve been working on this for years now, but it&#8217;s finally coming to fruition.  This alone will be a huge factor when deciding which technology to use.  I got a general feeling that Adobe is doubling its efforts in the Flash platform.</p>
<p>All and all, I got reassured at the conference that Flash and Flex aren&#8217;t going anywhere.  These upcoming changes to the platform will reverberate through the RIA community and hopefully increase its momentum.  One thing that Adobe seems to be somewhat clueless about is why isn&#8217;t there more Flash/Flex developers.  There are plenty of designers, but definitely not enough developers.  I told them that they should take a page out of Microsoft&#8217;s book.  Say what you will about Microsoft, they know how to treat their developers and they keep coming back.</p>
<p>I hope that Adobe figures that part out because a great platform with no developers still means failure.  I can say though that if you are a student, a junior developer or even want to switch technologies, I seriously recommend Flash/Flex.  It has spearheaded my career like I never thought possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michelboudreau.com/2010/11/04/adobe-max-post-conference-thoughts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flash Player 3D</title>
		<link>http://www.michelboudreau.com/2010/11/01/flash-player-3d/</link>
		<comments>http://www.michelboudreau.com/2010/11/01/flash-player-3d/#comments</comments>
		<pubDate>Mon, 01 Nov 2010 17:04:28 +0000</pubDate>
		<dc:creator>Michel Boudreau</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Adobe Max]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Flash Platform]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[alternativa]]></category>
		<category><![CDATA[flare]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[gpu]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[lab49]]></category>
		<category><![CDATA[molehill]]></category>
		<category><![CDATA[render]]></category>
		<category><![CDATA[Sebastian Marketsmueller]]></category>

		<guid isPermaLink="false">http://www.michelboudreau.com/?p=562</guid>
		<description><![CDATA[One of the big showcases of Adobe Max was the ...]]></description>
			<content:encoded><![CDATA[<p>One of the big showcases of Adobe Max was the possibility for the Flash Player to write directly to the video card using an API.  They&#8217;re calling it Flash 3D, but it&#8217;s not just limited to 3D.  It&#8217;ll be embedded directly into the next version of Flash Player, codename Molehill.</p>
<p><span id="more-562"></span>This is very exciting news for many reasons, but not only for game developer;  Flash and Flex developers could use the technology to their advantage.  With a full graphic API at your disposal that can write directly to the GPU, a developer could go a little crazy.  Most people think games when they hear 3D, but since we can write directly to the hardware, it also means more complex graphs or animations that doesn&#8217;t eat up CPU resources.</p>
<p>When the demos were shown, the graphics were impressive.  PS2 type of 3d quality and very smooth.  In some of the better examples shown (a driving game), the polygon count was over 100k but the CPU utilization was only 1%.  If this was software rendered instead, the polygon count would have had trouble going over 10k and the CPU would be fully utilized to keep up.</p>
<p>However, this new API means another learning curve to the whole process and not only on the software front, but also on the hardware front.  A developer needs to understand how Flash communicates with the hardware to be effective.  For instance, the GPU cannot render over normal display list graphics.  This is a limitation that is very important to know.  The short answer for the reason of this limitation is to reduce system bus congestion; you wouldn&#8217;t want to send over information to the GPU, render it, send it back to flash, overlay on top and send it back to the GPU.  It&#8217;s only one way, hence a UI can be overlaid on top of a 3D rendered scene, but not vice versa.  Also, since this is hardware based, there is no &#8216;retained&#8217; mode of rendering.  What this means is that the 3d stage gets re-rendered every frame, unlike the normal display list which only gets re-rendered when something changes.</p>
<p>When wanting to create your scene, you need to add a new class to the stage called Stage3D.  This is an object that runs separately from the normal stage (and display list).  You then need to add a context to that stage, and draw whatever you want to that context.  It&#8217;s pretty easy, but remember this is a very low-level API.  You&#8217;ll able to just draw a 3D object with it, for that you need a 3D framework that will draw all the triangles properly.  For that, there are many out there that are already taking advantage of Flash 3d, like <a href="http://alternativaplatform.com/en/" target="_blank">Alternativa </a>and <a href="http://www.flare3d.com" target="_blank">Flare</a>.</p>
<p>A cool feature about Flash 3D is that it can render to many rendering layers like DirectX 9 (and up), OpenGL 1.3, OpenGL ES2 (for mobile) or just plain old software rendering.  This can be set manually or Flash can choose automatically which one is best.  This is particularly important if you&#8217;re making games that are played by both desktop and mobile.</p>
<p>You can also use Adobe&#8217;s &#8220;Graphic Assembly Language&#8221; to make your own low-level code for the video card and do some funky things that you wouldn&#8217;t be able to out of the box.  It&#8217;s a very nice extension for hardcore hardware developers.</p>
<p>For now, Adobe is only concentrating on the rendering aspect of it, but are thinking of adding more features that would make development even easier, like support for 3D audio, physics and other gaming features.  All of this will be coming out with the next version of Flash Player in mid 2011 with a beta to be released &#8220;soon&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michelboudreau.com/2010/11/01/flash-player-3d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 1/28 queries in 0.009 seconds using disk: basic
Object Caching 538/615 objects using disk: basic

Served from: www.michelboudreau.com @ 2012-05-21 07:12:27 -->
