<?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>Yeah, But Is It Flash?</title>
	<atom:link href="http://www.yeahbutisitflash.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.yeahbutisitflash.com</link>
	<description>Random musings about all things Flash related</description>
	<lastBuildDate>Thu, 29 Jul 2010 23:11:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Goodbye Symbian. Hello Android</title>
		<link>http://www.yeahbutisitflash.com/?p=1664</link>
		<comments>http://www.yeahbutisitflash.com/?p=1664#comments</comments>
		<pubDate>Thu, 29 Jul 2010 22:53:28 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[Flash Mobile]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[google nexus one]]></category>
		<category><![CDATA[nokia]]></category>

		<guid isPermaLink="false">http://www.yeahbutisitflash.com/?p=1664</guid>
		<description><![CDATA[This wasn&#8217;t an easy decision. After all I&#8217;m supposed to be a Nokia fan boy. However, after much deliberation my trusty wee Nokia 5800 has been put aside and I&#8217;m now using the Google Nexus One as my primary mobile. Anyone who knows me will be well aware that I&#8217;m quite enthusiastic when it comes [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1664"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1664&amp;source=chriscaleb&amp;style=compact" height="61" width="50" /><br />
			</a>
		</div>
<p>This wasn&#8217;t an easy decision. After all I&#8217;m supposed to be a Nokia fan boy. However, after much deliberation my trusty wee <a href="http://www.forum.nokia.com/Devices/Device_specifications/5800_XpressMusic/" target="_">Nokia 5800</a> has been put aside and I&#8217;m now using the <a href="http://www.google.com/phone/static/en_US-nexusone_tech_specs.html" target="_">Google Nexus One</a> as my primary mobile.</p>
<p>Anyone who knows me will be well aware that I&#8217;m quite enthusiastic when it comes to the <a href="http://en.wikipedia.org/wiki/S60_(software_platform)" target="_">Symbian S60</a> operating system. It&#8217;s something I&#8217;ve grown comfortable with over the years and has always dictated what phone I get next.</p>
<p>I&#8217;ve been tinkering with Flash on mobile since Flash Lite appeared on the scene and Nokia have always done an excellent job of supporting Flash Lite on their mobile platforms. Flash is actually the reason I got my first Series 60 handset and it&#8217;s the reason why I&#8217;ve stuck with Nokia devices for so long.</p>
<p>However things are changing and Nokia don&#8217;t seem to be keeping up. Flash Player 10.1 and Adobe AIR 2.5 have now arrived on mobile and I&#8217;ve been desperate to explore both. Unfortunately there&#8217;s no sign of Flash Player 10.1 on any upcoming Nokia devices and they seem to be going with Flash Lite 4 in the short term rather than AIR.</p>
<p>So for the time being I&#8217;m moving over to Android, where I can get a much more complete web experience and also create cool Flash apps until my heart&#8217;s content.</p>
<p>This doesn&#8217;t mean I&#8217;ve become an overnight Nokia hater or anything. I will be keeping an eye out to see how things develop. The <a href="http://europe.nokia.com/find-products/devices/nokia-n8" target="_">Nokia N8</a> looks like it could be quite interesting &#8211; It&#8217;s just a shame its doesn&#8217;t support Adobe AIR.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yeahbutisitflash.com/?feed=rss2&amp;p=1664</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HP Windows 7 Slate</title>
		<link>http://www.yeahbutisitflash.com/?p=1653</link>
		<comments>http://www.yeahbutisitflash.com/?p=1653#comments</comments>
		<pubDate>Thu, 22 Jul 2010 21:57:26 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[Flash Mobile]]></category>
		<category><![CDATA[flash player 10.1]]></category>
		<category><![CDATA[HP Slate]]></category>
		<category><![CDATA[tablet]]></category>

		<guid isPermaLink="false">http://www.yeahbutisitflash.com/?p=1653</guid>
		<description><![CDATA[Does it look familiar? Of course it does, it&#8217;s the HP Windows 7 slate. It was certainly one of the most promising looking tablets on the horizon and I for one was a little upset when it looked like HP had pulled the plug on the project. Thankfully HP has just announced that it will [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1653"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1653&amp;source=chriscaleb&amp;style=compact" height="61" width="50" /><br />
			</a>
		</div>
<p>Does it look familiar? Of course it does, it&#8217;s the HP Windows 7 slate. It was certainly one of the most promising looking tablets on the horizon and I for one was a little upset when it looked like HP had pulled the plug on the project. Thankfully HP has just announced that it will arrive this fall/autumn.</p>
<p><a href="http://www.yeahbutisitflash.com/wp-content/uploads/2010/07/hp_webos_slate.jpg"><img class="aligncenter size-full wp-image-1657" title="hp_webos_slate" src="http://www.yeahbutisitflash.com/wp-content/uploads/2010/07/hp_webos_slate.jpg" alt="HP WebOS Slate" width="560" height="185" /></a></p>
<p>It&#8217;s a nice looking device and I&#8217;m hopeful that they&#8217;ve ironed out the usability and performance issues that we were hearing about from those who got their hands on early preview versions of the device. Best of all is that the HP Slate will support Adobe Flash within the browser. Not sure if it will have AIR support but fingers crossed.</p>
<p>Here&#8217;s some more <a href="http://www.crunchgear.com/2010/07/20/the-hp-slate-500-eight-models-of-windows-7-tablet-goodness/" target="_">info</a>.</p>
<p>Now what about a WebOS version? Now that would be interesting.</p>
<p>UPDATE: Looks like the slate is no longer a consumer products. Thanks to <a href="http://twitter.com/kaeladan" target="_">mnem</a> for sending this <a href="http://www.engadget.com/2010/07/22/hp-slate-no-longer-a-consumer-product-will-arrive-for-enterpris/" target="_">link</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.yeahbutisitflash.com/?feed=rss2&amp;p=1653</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flash Mobile Competitions</title>
		<link>http://www.yeahbutisitflash.com/?p=1641</link>
		<comments>http://www.yeahbutisitflash.com/?p=1641#comments</comments>
		<pubDate>Thu, 22 Jul 2010 21:27:10 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[Flash Mobile]]></category>
		<category><![CDATA[air 2.5]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[flash player 10.1]]></category>

		<guid isPermaLink="false">http://www.yeahbutisitflash.com/?p=1641</guid>
		<description><![CDATA[Flash competitions are like buses. You wait ages for one then three come along at the same time. But hey I&#8217;m not complaining and neither should you because three separate competitions simply means three more chances of winning something! Adobe are really starting to push the Flash platform on mobile and along with its partners [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1641"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1641&amp;source=chriscaleb&amp;style=compact" height="61" width="50" /><br />
			</a>
		</div>
<p>Flash competitions are like buses. You wait ages for one then three come along at the same time. But hey I&#8217;m not complaining and neither should you because three separate competitions simply means three more chances of winning something!</p>
<p>Adobe are really starting to push the Flash platform on mobile and along with its partners is looking for exciting game content that runs on either Adobe AIR for Android or Flash Player 10.1 for mobile. There are generous prizes on offer for each of the contests ranging from cash to software bundles.</p>
<p><a href="http://www.kongregate.com/pages/mobile-game-contest" target="_">Kongregate</a> are offering almost $30,000 in prizes including Adobe CS5: Web Premium for the top 5 entries. <a href="http://www.mochimedia.com/contest/jul10" target="_">Made for Mobile</a> are offering over $20,000 in prize money spread across 105 (yes 105) winners plus Adobe CS5: Master Suite for the best 3 entries. And lastly (but certainly not least) is <a href="http://www.flashgamelicense.com/sponsor_pages/adobe/" target="_">Cell Your Flash Game&#8217;s</a> contest where the top 3 will win Adobe CS5: Master Collection and take a split from a cash pot of $4310. The next 147 (this isn&#8217;t a typo either) people will receive $100 each and a few will also receive Adobe Flash Professional CS5.</p>
<p>So what are you waiting for? Get coding and see what you can come up with. Oh and try not to bite off more than you can chew. The submission dates are actually quite tight.</p>
<p>Right all I need now is a great idea! Err,&#8230;.. Damn! Oh well maybe next time <img src='http://www.yeahbutisitflash.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yeahbutisitflash.com/?feed=rss2&amp;p=1641</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Photobucket Mobile Site</title>
		<link>http://www.yeahbutisitflash.com/?p=1629</link>
		<comments>http://www.yeahbutisitflash.com/?p=1629#comments</comments>
		<pubDate>Mon, 19 Jul 2010 21:41:38 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[Flash Player 10.1]]></category>
		<category><![CDATA[flash player 10.1]]></category>
		<category><![CDATA[photobucket]]></category>

		<guid isPermaLink="false">http://www.yeahbutisitflash.com/?p=1629</guid>
		<description><![CDATA[here&#8217;s an interesting video showcasing the Flash Platform being used to deliver a mobile version of the Photobucket site. Before Flash Player 10.1 for mobile&#8217;s arrival the conversion effort to support video on mobile would have taken the Photobucket team several months. However by sticking with the Flash Platform the Photobucket team were mobile ready [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1629"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1629&amp;source=chriscaleb&amp;style=compact" height="61" width="50" /><br />
			</a>
		</div>
<p>here&#8217;s an interesting video showcasing the Flash Platform being used to deliver a mobile version of the Photobucket site. Before Flash Player 10.1 for mobile&#8217;s arrival the conversion effort to support video on mobile would have taken the Photobucket team several months. However by sticking with the Flash Platform the Photobucket team were mobile ready in a matter of days.</p>
<p>Vice President of Engineering Luke Swanson cited cost savings as a major factor. Using Flash removed the need to transcode and store multiple copies of their existing videos in different formats. It was also interesting to hear  Software Engineer, Chris Nguyen describe the process of porting their Flash content to the mobile site as &#8220;pretty much plug and play&#8221;.</p>
<div align="center"><object width="536" height="322"><param name="movie" value="http://images.tv.adobe.com/swf/player.swf"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="FlashVars" value="fileID=7136&#038;context=76&#038;embeded=true&#038;environment=production"></param><embed src="http://images.tv.adobe.com/swf/player.swf" flashvars="fileID=7136&#038;context=76&#038;embeded=true&#038;environment=production" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="536" height="322"></embed></object></div>
<p>I decided to see what all the fuss was about and took the mobile Photobucket site for a spin on my Google Nexus One using Flash Player 10.1 beta 3. The results were pretty impressive although I still think there are a few usability niggles that need ironed out &#8211; scrolling on a page that was mostly consumed by a video was a little tricky.</p>
<p>I&#8217;m sure the Photobucket team will be looking forward to Flash Player 10.1 rolling out across more mobile devices in the not so distant future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yeahbutisitflash.com/?feed=rss2&amp;p=1629</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My &#8220;Write Once, Run Anywhere&#8221; Experiment</title>
		<link>http://www.yeahbutisitflash.com/?p=1625</link>
		<comments>http://www.yeahbutisitflash.com/?p=1625#comments</comments>
		<pubDate>Wed, 14 Jul 2010 00:04:51 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[Flash Mobile]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[Flash Lite]]></category>
		<category><![CDATA[symbian]]></category>

		<guid isPermaLink="false">http://www.yeahbutisitflash.com/?p=1625</guid>
		<description><![CDATA[The Challenge There&#8217;s much talk of creating content once with Adobe Flash and running it just about anywhere. Now anyone who&#8217;s had experience writing Flash content for mobile will know that it&#8217;s not that simple (all devices aren&#8217;t equal after all) but hey, I&#8217;m always up for a challenge and thought I&#8217;d try and port [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1625"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1625&amp;source=chriscaleb&amp;style=compact" height="61" width="50" /><br />
			</a>
		</div>
<h2>The Challenge</h2>
<p>There&#8217;s much talk of creating content once with Adobe Flash and running it just about anywhere. Now anyone who&#8217;s had experience writing Flash content for mobile will know that it&#8217;s not that simple (all devices aren&#8217;t equal after all) but hey, I&#8217;m always up for a challenge and thought I&#8217;d try and port some web-based content to a wide range of handsets.</p>
<div align="center"><object width="536" height="402"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=13251739&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=13251739&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="536" height="402"></embed></object></div>
<p>So what to port? Well I recently <a href="index.php?p=1420" target="_">posted</a> about the <a href="http://www.weeworld.com" target="_">WeeWorld</a> Fame Game, which we released a few weeks back, and thought that it would be an ideal candidate. Now I appreciated the sensible thing would be to plan with mobile in mind from the outset but I was genuinely interested to see how difficult it would be to take content that was designed primarily for the web.</p>
<p>Now if you can&#8217;t be bothered reading on &#8211; it&#8217;s quite a long post &#8211; or don&#8217;t have the time then why not just watch the video above where you can see the results of my little experiment. If you want to know more then read on.<br />
<span id="more-1625"></span></p>
<h2>The Devices</h2>
<p>The first step was to decide on some phones. I could just have picked a bundle of devices that supported the same Flash runtime but that would have been cheating so I went with the following handsets and flavours of Flash:</p>
<ul>
<li>iPhone &amp; iPod touch &#8211; Adobe AIR / ActionScript 3</li>
<li>Google Nexus One &#8211; Adobe AIR / ActionScript 3</li>
<li>Nokia 5800 XpressMusic &#8211; Flash Lite 3.1 / ActionScript 2</li>
<li>Nokia N95 &#8211; Flash Lite 2.0 / ActionScript 2</li>
<li>Nokia 5310 XpressMusic &#8211; Flash Lite 2.1 / ActionScript 2</li>
</ul>
<p>Now that the handsets had been selected it was time to actually do some work.</p>
<h2>ActionScript 3 to ActionScript 2</h2>
<p>From the device list above there&#8217;s an obvious problem. In order to work on the Flash Lite handsets the Fame Game needed to be ported from AS3 to AS2. This was by far the biggest obstacle and took a few days to re-write. Maintaining two code bases for a project is hardly ideal but considering the extra device coverage it would give it was worth the effort.</p>
<p>Sure, Flash Lite 4 supports ActionScript 3. However until Flash Lite 4 devices start to gain some penetration most developers will probably have to fall-back to lower versions of Flash Lite, which unfortunately means using ActionScript 2 for the time being.</p>
<p>We&#8217;re clearly in a transitional phase for Flash and mobile. Flash Lite was a very good toe in the water for Adobe but considering the pace at which people upgrade their handsets, it&#8217;s clear that ActionScript 2&#8242;s days are numbered. From this point onwards devices are going to support either Adobe AIR (high-end devices) or Flash Lite 4 (lower-end devices) both of which support ActionScript 3.</p>
<p>However for the time being you&#8217;ll probably have to stick with AS2 to capture as wide an audience as possible.</p>
<h2>Layout</h2>
<p>One major headache for any mobile developer, no matter what language they&#8217;re using, is the fact that screen dimensions vary wildly across devices. Ensuring your application fits all these different screens is difficult enough when considering mobile from the outset, but I had the added problem of working with something that had originally been designed for the web where one size fits all.</p>
<p>Thankfully the Fame Game&#8217;s original layout was such that it could quite easily be tailored for different dimensions. The big question was whether to write code to dynamically alter the layout on-the-fly or to simply code for each screen. I opted to code for and create separate builds for each screen. I felt this would give me more control over the layout and with minimal effort.</p>
<p>This also allowed me to create multiple FLAs &#8211; one for each target device. Although the original code base performed much of the layout, where appropriate, layout was taken care of on the Stage. The visual assets themselves were all pre-sized and stored in the library. By creating multiple FLAs I was able to re-purpose the original artwork for each of the target screens, without resorting to bundling multiple versions of the same artwork into the one FLA.</p>
<p>Now you might think that coding for multiple screen layouts would bloat the final build size. After all, if you target five difference screen sizes then surely you&#8217;d have to include in the final SWF code to perform the layout for all five screens? Well I managed to avoid that by creating separate layout classes for each screen and ensuring that each build pointed to only the layout class that was required.</p>
<p>Here&#8217;s roughly how the folder structure looked for this code:</p>
<blockquote><p><code>src/platform/android/Layout.as<br />
src/platform/iphone/Layout.as<br />
src/platform/web/Layout.as</code></p></blockquote>
<p>The important thing to note from the folder structure above is that although each class is in a different folder, they all have identical fully-qualified class paths. Essentially it is the same class but in three different locations. Each class holds static data that is used to define layout information related to a particular device&#8217;s screen dimensions.</p>
<p>Now to target the Google Nexus One I simply added a class path to its FLA&#8217;s publish profile that pointed to <code>src/platform/android</code>. For the iPhone FLA I added a class path that pointed to  <code>src/platform/iphone</code>, and for the standard web version&#8217;s FLA I added a class path to  <code>src/platform/web</code>.</p>
<p>The final step was to work my way through the existing Fame Game code and replace any layout-specific code with calls to the Layout class. So whereas before there might have been screen-specific code that looked like this:</p>
<blockquote><p><code>// Position the WeeMee just off-screen.<br />
weemee.x = -340;<br />
weemee.y = -30;</code></p></blockquote>
<p>We now have the following screen-independent code, where the Layout class used is determined by the class path set in the publish profile:</p>
<blockquote><p><code>// Position the WeeMee just off-screen.<br />
weemee.x = Layout.weemee.x;<br />
weemee.y = Layout.weemee.y;</code></p></blockquote>
<p>With this implementation, any new screen sizes can be implemented without bulking up the final SWF size. It also provides tighter control over the layout compared to a dynamic layout implementation.</p>
<h2>The WeeMees</h2>
<p>Central to the WeeWorld site is the WeeMee avatar and it&#8217;s these little cute characters you get to vote for in the Fame Game. WeeMees are dynamically generated on our server using Blue Pacific&#8217;s Turbine and served as Flash 7 SWFs with a smattering of ActionScript 2 used to perform certain animations and effects.</p>
<p>Although this approach works a treat on our live site things were a little different for my mobile versions. Only the Nokia 5800, which supports Flash Lite 3, was able to actually load the WeeMee SWFs.</p>
<p>Both the N95 and the Nokia 5310 were restricted to Flash Lite 2.x, which had some rendering issues with the WeeMees. AIR for iPhone does not support the loading of external SWFs that contain ActionScript so SWFs were out of the question for that. And although AIR for Android can load external SWFs it only supports SWFs with ActionScript 3, so WeeMee SWFs were a no-no there too.</p>
<p>Thankfully at WeeWorld we can fall-back to using PNGs of our WeeMees, which turned out to be quite handy for this challenge. So for the iPhone and Google Nexus One versions I changed the config settings for each to request PNG WeeMees from the server.</p>
<p>Unfortunately the Flash Lite runtimes on both the Nokia N95 and 5310 didn&#8217;t support PNGs so a few additional changes had to be made. Instead of serving PNGs to these devices some code was written on the server to convert the PNGs to JPEG. This had one side-effect &#8211; any transparency behind the WeeMee was lost, which in turn blocked-out the nice gradient background within the app and generally looked quite ugly.</p>
<p>It wasn&#8217;t a big deal though. For these two devices I removed the gradient background and replaced it with a solid colour. I then ensured that the same colour was rendered behind the WeeMee JPGs that were now coming from the server. It worked quite well and most people wouldn&#8217;t have been aware of the changes when using it.</p>
<p>You might think that this all sounds like a huge amount of ActionScript changes were required for each target device. However, the reality was that the work was really all done on the server, and the ActionScript itself actually remained relatively unchanged.</p>
<h2>Keypad Support</h2>
<p>The final hurdle was to add keypad support for the Nokia N95 and Nokia 5310. The other devices supported touch-screen meaning that no code changes were required from the original web version &#8211; both AIR and Flash Lite 3 can handle the touch events as if they are mouse events, which in my case was a major time saver.</p>
<p>Keypad support was required to allow the user to move between the three voting icons and make a selection. The voting icons were all managed by a <code>VoteIcons</code> class, and adding keypad support wasn&#8217;t that difficult. These changes were only made to the ActionScript 2 code base since all the ActionScript 3 builds were for touch screen phones.</p>
<p>The first step was to move <code>VoteIcons</code> into the root of the <code>platforms</code> folder that was first created to help with layout. The class was then renamed to <code>VoteIconsBase</code> and a new method named <code>onKeyDown</code> was added. The top-level application class was then made to listen for key events and pass them to the <code>VoteIconsBase</code> class.</p>
<p>Within each of the platform specific folders a new class was created called <code>VoteIcons</code> that extended <code>VoteIconsBase</code>. The folder structure looked like this:</p>
<blockquote><pre><code>src/platform/
             VoteIconsBase.as
             n5310/
                    VoteIcons.as
             n95/
                    VoteIcons.as
             n5800/
                    VoteIcons.as
</pre>
<p></code></p></blockquote>
<p>The implementation for <code>onKeyDown</code> within <code>VoteIconsBase</code> does nothing. Instead it relies on the sub-classes overriding it. Since the Nokia 5800 is a touch-screen device, it's sub class does nothing with the <code>onKeyDown</code> method. Both the Nokia 5310 and Nokia N95 versions of <code>VoteIcons</code> however do have implementations for this method, ensuring that the key events are handled and the correct icon is highlighted and selected.</p>
<p>As with the layout handling, certain class paths had to be added to each FLA's publish profile depending on the target device.</p>
<p>Every FLA required the <code>VoteIconsBase</code> class, so the following was added to each FLA's class path: <code>/src/platform</code>.</p>
<p>Then one additional class path was added depending on the target device. So the Nokia 5800's publish profile was pointed towards <code>/src/platform/n5800</code>; the Nokia 5300 FLA looked for the <code>VoteIcons</code> class in <code>/src/platform/n5300</code>; and the Nokia N95 build got its code from <code>/src/platform/n95</code>.</p>
<h2>Optimisation</h2>
<p>While porting to the various mobile devices I attempted not to optimise the code - I felt it went against the spirit of the challenge. However I did allow myself to make some tweaks to each of the FLAs where I felt it might help device performance.</p>
<p>With the exception of the Google Nexus One I reduced the frame rates to suit each device:</p>
<ul>
<li>Google Nexus One - 30fps</li>
<li>iPhone - 16fps</li>
<li>Nokia 5800 XpressMusic - 16fps</li>
<li>Nokia N95 - 12fps</li>
<li>Nokia 5310 XpressMusic - 12fps</li>
</ul>
<p>When repurposing the graphics for each FLA I was careful to ensure that all library clips were already scaled to fit the device's screen - Resizing instances on the stage is a very bad idea and can seriously hurt performance on mobile.</p>
<p>The iPhone's FLA also got some extra attention. I replaced some of the vector graphics with bitmap versions (I really should have done this for all devices) and also set many of the movie clip instances to 'Cache as bitmap' ensuring that they got stored on the iPhone's GPU for faster rendering.</p>
<p>I could have spent more time on the iPhone version to bring its frame rate up to 30fps, but it would have required code changes and considering Apple's ban on Flash content anyway I felt it wasn't worth the effort, and as I had stated before it went against the spirit of the challenge.</p>
<h2>Coverage</h2>
<p>So I ended up with the Fame Game running on five different devices. I was also planning on creating a version for my <a href="http://mariamdholkawala.com/mobile/?p=402" target="_">Sony Ericsson W705</a> but unfortunately it recently died and is now looking down on us from <a href="http://en.wikipedia.org/wiki/Silicon_Heaven" target="_">Silicon Heaven</a>.</p>
<p>Now given the sheer number of devices out there, five doesn't seem like that many so let's spend a little time explaining why I selected these devices - it wasn't random you know.</p>
<p>Both the Nokia N95 and Nokia 5800 use the Symbian S60 operating system. For those who don't know, Symbian phones are everywhere and the OS currently holds the lions share of the smartphone market. In the first quarter of this year over 25 million Symbian S60 smartphones were sold. That's 44% of all smartphones sold worldwide in that quarter!</p>
<p>I performed a quick check in Adobe Device Central CS5 and counted 72 Nokia handsets alone that would run the exact same builds of the Fame Game that I deployed to the N95 and 5800. I'm not entirely sure just how many different handsets Nokia has but I'm pretty sure those 72 listed in Device Central would cover a significant number of them. So by targeting Flash Lite 2 and Symbian S60 you're effectively targeting millions of devices.</p>
<p>The Nokia 5310 XpressMusic isn't a smartphone, it's a fairly inexpensive mass market handset that runs the S40 operating system. Device Central listed 35 S40 phones that would run the same build of the Fame Game that was deployed to the Nokia 5310. Again that seems like a fairly good result to me and shows the value in continuing to target Flash Lite in the short term.</p>
<p>Now onto the iPhone/iPod touch. Okay I know Apple has banned any content written in Flash from the App Store but I had my iPod touch lying around and thought it would be a shame not to include it in the challenge. But if Apple were to have a change of heart then the Fame Game would run on the 51 million iPhones and 20 million iPod touches that have been sold over the last 3 years or so.</p>
<p>Finally there's the Google Nexus One, which runs the Android operating system. With 5 million handsets being sold in the first quarter of this year alone Android is gathering some significant momentum and going forward could be the mobile platform of choice for Flash developers.</p>
<p>So you see by carefully targeting a few key handsets I've managed to capture quite a large slice of the mobile space for the Fame Game app.</p>
<h2>Conclusion</h2>
<p>Okay, so it's clear Adobe isn't quite there yet with its "Write Once, Run Anywhere" vision but I honestly don't think they're that far off - In my case it was "Write Twice, Run on Lots of Devices".</p>
<p>In the short term it's probably still beneficial to target some of the older handsets that only support ActionScript 2, but as Adobe AIR and Flash Lite 4 roll out across more smartphones AS2 will quickly become irrelevant.</p>
<p>The Flash Platform is an excellent development platform and it's comforting to know that you can use the same tools and language to develop across a wide range of devices. Sure there will always be a need for native apps where performance is critical, but for a vast number of projects out there Flash will be an ideal choice.</p>
<p>So exactly how long did it take me to get the Fame Game running on these devices? After all this has turned into a monster blog entry and that might give the misconception that it took quite some time. Here's a breakdown for you:</p>
<table style="position: relative; left:25px;">
<tr>
<th>Task</th>
<th>Hours</th>
<th>Notes</th>
</tr>
<tr>
<td>Port AS3 to AS2</td>
<td>16</td>
<td>By far the biggest task.</td>
</tr>
<tr>
<td>iPhone</td>
<td>4</td>
<td>Layout class, Graphics work.</td>
</tr>
<tr>
<td>Google Nexus One</td>
<td>3</td>
<td>Layout class, Graphics work.</td>
</tr>
<tr>
<td>Nokia N95</td>
<td>5</td>
<td>Layout class, Graphics work, Keypad interaction.</td>
</tr>
<tr>
<td>Nokia 5310</td>
<td>1</td>
<td>Layout class.</td>
</tr>
<tr>
<td>Nokia 5800</td>
<td>3</td>
<td>Layout Class, Graphics work.</td>
</tr>
<tr>
<td>Total Time</td>
<td colspan="2">32</td>
</tr>
</table>
<p>As a side-note, I've always been happy with Nokia's commitment to Flash, and I'm looking forward to getting my hands on a Flash Lite 4 device at some point. It's relatively easy to write Flash content, test it in Device Central then deploy it onto one of their handsets.</p>
<p>It's also comforting to know that this also holds true for Flash development on the Google Nexus One (and hopefully other Android devices). From the relatively short amount of time I've had to play with it I can honestly say it's the easiest device yet to get Flash content installed and running on. The performance of Flash on the Nexus One is also seriously impressive.</p>
<p>So there you have it. Approximately four days effort has produced Flash content that can run on millions of handsets. Impressive stuff if you ask me.</p>
<p>And if you made it all the way to the end then thanks for persevering!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yeahbutisitflash.com/?feed=rss2&amp;p=1625</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Future of Flash is 3D</title>
		<link>http://www.yeahbutisitflash.com/?p=1514</link>
		<comments>http://www.yeahbutisitflash.com/?p=1514#comments</comments>
		<pubDate>Wed, 07 Jul 2010 20:38:48 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[3D API]]></category>
		<category><![CDATA[MAX 2010]]></category>

		<guid isPermaLink="false">http://www.yeahbutisitflash.com/?p=1514</guid>
		<description><![CDATA[I asked in my last post if Adobe&#8217;s focus on mobile would limit the features we&#8217;d see in future versions of Flash. Well looks like I have an answer via Thibault Imbert&#8217;s blog where he teases us all with talk of Flash&#8217;s next generation 3D API. For those wanting to know more, Flash Player engineer [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1514"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1514&amp;source=chriscaleb&amp;style=compact" height="61" width="50" /><br />
			</a>
		</div>
<p>I asked in my <a href="index.php?p=1492" target="_">last post</a> if Adobe&#8217;s focus on mobile would limit the features we&#8217;d see in future versions of Flash. Well looks like I have an answer via <a href="http://www.bytearray.org/?p=1836" target="_">Thibault Imbert&#8217;s blog</a> where he teases us all with talk of Flash&#8217;s next generation 3D API.</p>
<p>For those wanting to know more, Flash Player engineer Sebastian Marketsmueller will be holding a session at <a href="http://max.adobe.com/" target="_">Adobe MAX 2010</a> where he&#8217;ll delve deep into Flash 3D. So just how sophisticated is Flash&#8217;s 3D support going to be? Well I guess we&#8217;ll need to wait and see but without giving much away Thibault promises that some serious stuff is coming for 3D developers.</p>
<p>You can find a schedule for this years MAX sessions <a href="http://max.adobe.com/schedule/by-session/" target="_">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yeahbutisitflash.com/?feed=rss2&amp;p=1514</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Will mobile limit future Flash features?</title>
		<link>http://www.yeahbutisitflash.com/?p=1492</link>
		<comments>http://www.yeahbutisitflash.com/?p=1492#comments</comments>
		<pubDate>Sat, 03 Jul 2010 22:36:57 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[Flash Mobile]]></category>
		<category><![CDATA[flash player 10.1]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://www.yeahbutisitflash.com/?p=1492</guid>
		<description><![CDATA[Okay this is a slightly controversial post but it&#8217;s something that&#8217;s been nagging at me for a good few months now so I thought I&#8217;d put it out there and see what people think. Will Adobe&#8217;s mobile vision for Flash restrict future features? &#8220;Why would it?&#8221; you might ask. Well the whole point of Flash [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1492"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1492&amp;source=chriscaleb&amp;style=compact" height="61" width="50" /><br />
			</a>
		</div>
<p>Okay this is a slightly controversial post but it&#8217;s something that&#8217;s been nagging at me for a good few months now so I thought I&#8217;d put it out there and see what people think.</p>
<p>Will Adobe&#8217;s mobile vision for Flash restrict future features?</p>
<p>&#8220;Why would it?&#8221; you might ask. Well the whole point of Flash Player 10.1 for mobile is to deliver the exact same desktop web experience to our mobile devices. Considering the performance gap between desktop and mobile it surely wouldn&#8217;t make sense for Adobe to add any new features to Flash that were CPU intensive or memory hungry. Such a strategy would risk producing content that performs poorly on mobile and gives Flash a bad name. Unfortunately the really cool features are often the ones that require fast CPUs and bags of RAM.</p>
<p>Adobe has committed considerable time and effort educating developers about mobile and encouraging them to optimise their existing Flash content &#8211; Take a look at the <a href="http://www.bytearray.org/wp-content/projects/ads-optimizations/Ads%20Optimizations%20-%20v1.pdf" target="_">Ads Optimizations</a> and <a href="http://help.adobe.com/en_US/as3/mobile/index.html" target="_">Optimizing Performance for the Flash Platform</a> white papers. It&#8217;s clear they&#8217;re desperate to ensure that web-based Flash content runs well on mobile and shows Flash in a good light, so I seriously doubt they&#8217;ll want to introduce any new features to the player that might cause problems on mobile.</p>
<p>You could argue that Adobe should just keep adding great new features regardless of how well they might run on mobile and leave developers to decide whether or not to use them. The problem with this approach however is that they risk fragmenting the web with great content that runs brilliantly on desktop but poorly on mobile, which is exactly what they&#8217;re trying to prevent at the moment.</p>
<p>Sure, as time goes on, mobile devices will get faster and faster but there is always going to be a gulf between the power of mobile handsets and desktops. My guess, and my hope is that Adobe let their mobile strategy dictate, to a certain extent, the future of Flash and the features that we&#8217;ll see in upcoming releases.</p>
<p>In the short term I think it&#8217;s very important we start to see some performance parity between mobile and desktop Flash content. Much of it is down to the developers producing the content but I think Adobe can help by ensuring that any new features aren&#8217;t likely to melt our mobile phones.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yeahbutisitflash.com/?feed=rss2&amp;p=1492</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why YouTube Primarily Uses Flash</title>
		<link>http://www.yeahbutisitflash.com/?p=1480</link>
		<comments>http://www.yeahbutisitflash.com/?p=1480#comments</comments>
		<pubDate>Tue, 29 Jun 2010 22:09:09 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[YouTuble]]></category>

		<guid isPermaLink="false">http://www.yeahbutisitflash.com/?p=1480</guid>
		<description><![CDATA[There&#8217;s a really interesting post over on the YouTube API Blog from Google&#8217;s YouTube team explaining their reasons for using the Flash Platform to deliver video. The article discusses the advantages Flash currently has over the HTML5 &#60;video&#62; tag including: A Standardised Video Format Robust Video Streaming Content Protection Encapsulation &#38; Embedding of Video Fullscreen [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1480"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1480&amp;source=chriscaleb&amp;style=compact" height="61" width="50" /><br />
			</a>
		</div>
<p>There&#8217;s a really interesting post over on the <a href="http://apiblog.youtube.com/2010/06/flash-and-html5-tag.html" target="_">YouTube API Blog</a> from Google&#8217;s YouTube team explaining their reasons for using the Flash Platform to deliver video.</p>
<p>The article discusses the advantages Flash currently has over the HTML5 &lt;video&gt; tag including:</p>
<ul>
<li>A Standardised Video Format</li>
<li>Robust Video Streaming</li>
<li>Content Protection</li>
<li>Encapsulation &amp; Embedding of Video</li>
<li>Fullscreen Support</li>
<li>Camera and Microphone access</li>
</ul>
<p>It&#8217;s definitely worth your while reading through the article and I&#8217;ll leave you with this quote, which I think sums things up nicely.</p>
<blockquote><p>Today, Adobe Flash provides the best platform for YouTube’s video distribution requirements, which is why our primary video player is built with it.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.yeahbutisitflash.com/?feed=rss2&amp;p=1480</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Player 10.1 on Android 2.2</title>
		<link>http://www.yeahbutisitflash.com/?p=1469</link>
		<comments>http://www.yeahbutisitflash.com/?p=1469#comments</comments>
		<pubDate>Tue, 29 Jun 2010 15:57:23 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[Flash Player 10.1]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[flash player 10.1]]></category>

		<guid isPermaLink="false">http://www.yeahbutisitflash.com/?p=1469</guid>
		<description><![CDATA[Thought I&#8217;d share a video I stumbled upon today showing the latest beta build of Flash Player 10.1 running on an Android 2.2 handset. I&#8217;m pleased to say that the performance now looks significantly better than the first beta build I got to play with at the Adobe CS5 Road Show in Edinburgh. I guess [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1469"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1469&amp;source=chriscaleb&amp;style=compact" height="61" width="50" /><br />
			</a>
		</div>
<p>Thought I&#8217;d share a video I stumbled upon today showing the latest beta build of Flash Player 10.1 running on an Android 2.2 handset. I&#8217;m pleased to say that the performance now looks significantly better than the first beta build I got to play with at the Adobe CS5 Road Show in Edinburgh. I guess from the performance gains I&#8217;d say that hardware acceleration has now been switched on, which was definitely missing when I tried it out.</p>
<div align="center"><object width="536" height="324"><param name="movie" value="http://www.youtube.com/v/jhJX92201aQ&#038;rel=0&#038;color1=0xb1b1b1&#038;color2=0xd0d0d0&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/jhJX92201aQ&#038;rel=0&#038;color1=0xb1b1b1&#038;color2=0xd0d0d0&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="536" height="324"></embed></object></div>
<p>From the video it also looks like many of the usability issues have also been ironed out &#8211; previously it was very difficulty to switch into full-screen mode but it does seem much more intuitive now. Some Flash heavy sites do still seem to be a problem though. The UFC site at the end of the video seemed quite sluggish and unresponsive as its content loaded, and there were also a few occasions where full-screen video looked a little choppy. Hopefully Adobe can fix these remaining issues.</p>
<p>For the most part however I was once again very impressed and looking forward to a final build of Flash Player 10.1 making it onto handsets.</p>
<p><strong>Update: </strong>I&#8217;ve just been informed that Flash Player 10.1 for Android went live about a week ago. I&#8217;ll need to try and stay in the loop &#8211; it&#8217;s been a busy past two weeks for me though so at least I have an excuse <img src='http://www.yeahbutisitflash.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Thanks to <a href="http://www.noiseandheat.com/blog/" target="_">Dave</a> for informing me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yeahbutisitflash.com/?feed=rss2&amp;p=1469</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash content doesn&#8217;t have to be bloated</title>
		<link>http://www.yeahbutisitflash.com/?p=1420</link>
		<comments>http://www.yeahbutisitflash.com/?p=1420#comments</comments>
		<pubDate>Mon, 21 Jun 2010 21:29:24 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[SWF]]></category>

		<guid isPermaLink="false">http://www.yeahbutisitflash.com/?p=1420</guid>
		<description><![CDATA[I keep hearing from friends and colleagues that Flash is notoriously slow and the content it produces is hopelessly bloated. Of course this simply isn&#8217;t true but recently I&#8217;ve been finding out the hard way that it&#8217;s not easy to convince many of them otherwise. Now I&#8217;m not attempting to turn this into a Flash [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1420"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.yeahbutisitflash.com%2F%3Fp%3D1420&amp;source=chriscaleb&amp;style=compact" height="61" width="50" /><br />
			</a>
		</div>
<p>I keep hearing from friends and colleagues that Flash is notoriously slow and the content it produces is hopelessly bloated. Of course this simply isn&#8217;t true but recently I&#8217;ve been finding out the hard way that it&#8217;s not easy to convince many of them otherwise.</p>
<p>Now I&#8217;m not attempting to turn this into a Flash v HTML5 debate but I do believe that some of these misconceptions have been borne out from the war that has erupted between those who support Flash and those who want it gone. However I feel most of the blame lies with those who use Flash and I do confess to being as guilty as the next man when it comes to writing large SWFs that use poor loading strategies.</p>
<p>It is all too easy to create unnecessarily large SWFs by producing hopelessly large vector images, packing your SWF with high-quality bitmaps, and forcing all your code and resources to load up-front. Ignore everything that&#8217;s great about Flash and you&#8217;ll soon have users yawning as they wait for the entire SWF to download before they&#8217;re able to try out your latest masterpiece.</p>
<p>So in an attempt to re-educate many of the non-Flash developers at <a href="http://www.weeworld.com" target="_">WeeWorld</a> I set myself the task of ensuring that any Flash content produced for our latest project would be as small as possible without a loss of perceived quality.</p>
<p>But first we had to decide if Flash was required at all. From the initial mock-ups it was clear that HTML, JavaScript and some server-side cleverness would take care of the majority. There was however one section right in the centre of the page that was screaming out to be done in Flash (or at least that&#8217;s what I believed).</p>
<div id="attachment_1450" class="wp-caption center" style="width: 570px"><a href="http://www.yeahbutisitflash.com/wp-content/uploads/2010/06/mock-up.jpg"><img class="size-full wp-image-1450" title="mock-up" src="http://www.yeahbutisitflash.com/wp-content/uploads/2010/06/mock-up.jpg" alt="Fame Game mock-up" width="560" height="368" /></a><p class="wp-caption-text">Hey! I want to be Flash!!!</p></div>
<p>The centre panel in the mock-up above represents a little voting game where users get to vote for their favourite WeeMees during a fashion contest. Each time the user votes a new WeeMee is loaded from the server and slides into view. After voting, a panel is updated showing the current voting statistics for that WeeMee. To ensure the voting experience was as fluid as possible we decided to cache WeeMee SWFs up-front to reduce loading time between votes.</p>
<p>First I had to justify it. After all, some team members quite rightly stated that it could probably be done in JavaScript. In the end though we went with Flash for the following reasons.</p>
<ul>
<li>We&#8217;d need to load WeeMees, which are all dynamically generated on our server as SWFs.</li>
<li>Flash would give us good cross-browser support without the need for any browser-specific code.</li>
<li>The visuals could easily be reproduced using Flash&#8217;s vector drawing tools.</li>
<li>The vector content would be a fraction of the size of bitmaps.</li>
<li>ActionScript is compiled into a compact byte-code without sacrificing the legibility of the source.</li>
<li>I moaned at my boss <a href="http://www.macdog.co.uk/blog/" target="_">MacDog</a> for two weeks straight until he relented.</li>
</ul>
<p>So how did I get on? Well in the end I split the project into two SWFs &#8211; a preloader SWF and the main SWF. The preloader came in at 4K with the other being around 12K. The combined total was a minuscule 16K! To be honest given the tiny file size it was perhaps overkill having a preloader but heh, I&#8217;d rather the user had to wait for 4K to download before seeing something rather than 12K.</p>
<p>The point of the preloader wasn&#8217;t to actually feedback to the user how much of the content had loaded &#8211; after all everything loaded too quickly for there to be such a need. Instead it was created to force a visual onto the screen as quickly as possible therefore giving the user the perception that the content had loaded. I was eager to, as quickly as possible, plug the hole in the HTML page where the Flash content would be rendered, and the preloader gave me that opportunity.</p>
<div id="attachment_1444" class="wp-caption center" style="width: 570px"><a href="http://www.yeahbutisitflash.com/wp-content/uploads/2010/06/high-level-breakdown.jpg"><img class="size-full wp-image-1444" title="high-level-breakdown" src="http://www.yeahbutisitflash.com/wp-content/uploads/2010/06/high-level-breakdown.jpg" alt="Size breakdown across both SWFs." width="560" height="400" /></a><p class="wp-caption-text">High level breakdown of SWFs.</p></div>
<p>The diagram above shows roughly how each SWF looks and more importantly a high-level breakdown of sizes. The preloader&#8217;s (left hand-side) content is more-or-less split 50-50 by code and embedded fonts. The final size of the graphics within the preloader was perhaps the most pleasing, with the vector content only consuming 185 bytes!</p>
<p>It was a similar story with the main SWF (right hand-side). The ActionScript consumed the majority of the file size while the graphics consumed next to nothing. This time the vector artwork was a little larger but still comfortably under a kilobyte, coming in at 479 bytes. Unlike the preloader I was able to use device fonts for the main SWF, further helping to reduce the final SWF size.</p>
<p>I could quite easily reduce the total SWF size further by spending time shortening function and variable names. There are of course many other ways to squeeze the code down but I was eager to keep it as legible and maintainable as possible. The total size of the ActionScript source across both SWFs was 41K but was reduced to 13K after compilation.</p>
<p>I&#8217;m happy with the result along with everyone else at <a href="http://www.weeworld.com" target="_">WeeWorld</a>. Many were pleasantly surprised at the final SWF sizes and hopefully it has gone a long way towards making individuals realise that there&#8217;s absolutely nothing wrong with the Flash Player or the SWF format.</p>
<p>If you want to keep file sizes down I&#8217;d suggest you spend as much time and effort optimising your vector content &#8211; it&#8217;s certainly where the majority of savings were made on this project. Where possible re-use content by storing your artwork in movie clips and using instances of those clips. In fact take a look at the diagram below for a more in-depth breakdown of the vector graphics used within the SWFs.</p>
<div id="attachment_1440" class="wp-caption center" style="width: 570px"><a href="http://www.yeahbutisitflash.com/wp-content/uploads/2010/06/low-level-breakdown.jpg"><img class="size-full wp-image-1440" title="low-level-breakdown" src="http://www.yeahbutisitflash.com/wp-content/uploads/2010/06/low-level-breakdown.jpg" alt="Breakdown of sizes." width="560" height="376" /></a><p class="wp-caption-text">Size breakdown across SWFs.</p></div>
<p>Also spend time thinking about your font usage. Only embed fonts if you really must. Where possible use device fonts, which will help reduce significantly the final size of your SWF. And although it wasn&#8217;t an issue with this project, if you find your byte-code size getting out of hand then you many want to split your code into separate libraries and load them at run-time when needed.</p>
<p>If you&#8217;re still in any doubt as to the compactness of the SWF format then perhaps this might give you some context. I examined the size of a single JPEG (260 x 274 pixels) loaded onto the front page of the WeeWorld site. It was a fairly compact 31K in size. Now compare that to the 16K total of our two SWF files (360 x 459 pixels). That&#8217;s right, our fully interactive Flash content with graphics, fonts and animation was half the size of a JPEG!</p>
<p>Anyone still want to argue that Flash can&#8217;t produce compact content?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yeahbutisitflash.com/?feed=rss2&amp;p=1420</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
