<?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>Renaun Erickson</title>
	<atom:link href="http://renaun.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://renaun.com/blog</link>
	<description>Informtation on Flex, Flash, ColdFusion, and general RIA web develoment.</description>
	<lastBuildDate>Thu, 02 Sep 2010 14:27:08 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adobe Flash Player in Latest Device News</title>
		<link>http://renaun.com/blog/2010/09/adobe-flash-player-in-latest-device-news/</link>
		<comments>http://renaun.com/blog/2010/09/adobe-flash-player-in-latest-device-news/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 14:27:08 +0000</pubDate>
		<dc:creator>Renaun Erickson</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://renaun.com/blog/?p=675</guid>
		<description><![CDATA[Here are a few of the latest news and blog posts about different devices coming out with or recently updated support for Adobe Flash Player.
Samsung: Galaxy Tab has leg up on Apple iPad
Android, though it lags iOS-based devices in gaming titles, does have a wide range of applications. Samsung pointed out that the Galaxy Tab [...]]]></description>
			<content:encoded><![CDATA[<p>Here are a few of the latest news and blog posts about different devices coming out with or recently updated support for Adobe Flash Player.</p>
<p><a href="http://news.cnet.com/8301-30685_3-20015400-264.html">Samsung: Galaxy Tab has leg up on Apple iPad</a></p>
<blockquote><p>Android, though it lags iOS-based devices in gaming titles, does have a wide range of applications. Samsung pointed out that the Galaxy Tab will run <strong>Adobe Systems&#8217; Flash Player 10.1</strong>, which opens the doors to more games available over the Web.</p></blockquote>
<p><a href="http://www.marketwire.com/press-release/ARCHOS-Introduces-Five-New-Android-Tablets-Starting-Below-100-1312120.htm">ARCHOS Introduces Five New Android Tablets Starting Below $100</a></p>
<blockquote><p>A PC-like super-fast web browsing experience </p>
<p>Featuring a powerful 1 GHz processor, high-speed WiFi-n technology and sleek high-resolution screen, the new Android-based tablets offer a fast and enjoyable PC-like web browsing experience. Users can access the entire internet thanks to Android&#8217;s support for <strong>Adobe Flash™ 10.1</strong> player.</p></blockquote>
<p><a href="http://www.verizonwireless.com/b2c/store/controller?item=phoneFirst&#038;action=viewPhoneDetail&#038;selectedPhoneId=5269&#038;changingCompletedOrder=&#038;capId=&#038;phoneTopRated=">HTC Droid Incredible on Verizon Wireless</a> &#8211; Click on Capabilities tab on product page after entering location information, Froyo 2.2 updates have been going out for existing phones.</p>
<blockquote><p>Skype Mobile Capable<br />
3G Mobile Hotspot Capable<br />
VZ Navigator® Capable<br />
Backup Assistant Capable<br />
Visual Voice Mail capable<br />
Backup Assistant capable<br />
Mobile Broadband Connectcapable<br />
HTML Browser: <strong>Supports Adobe Flash 10.1</strong><br />
WiFi® capable 802.11 b/g/n</p></blockquote>
                <p><center>&copy; %FIRST Erickson &#8211; visit the <a href="http://www.renaun.com">&lt;renaun.com:flexblog text=&#8221;{ ModelLocator.myThoughts }&#8221;/&gt;</a> </center></p>            ]]></content:encoded>
			<wfw:commentRss>http://renaun.com/blog/2010/09/adobe-flash-player-in-latest-device-news/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Droid Incredible Update to Froyo with Flash Player in the Update</title>
		<link>http://renaun.com/blog/2010/09/droid-incredible-update-to-froyo-with-flash-player-in-the-update/</link>
		<comments>http://renaun.com/blog/2010/09/droid-incredible-update-to-froyo-with-flash-player-in-the-update/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 02:17:02 +0000</pubDate>
		<dc:creator>Renaun Erickson</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://renaun.com/blog/?p=661</guid>
		<description><![CDATA[My wife&#8217;s Droid Incredible received the Froyo update notice today. Interestingly it mentions Flash Player in the update text. Here is some highlights from the text: &#8220;This Android&#8482; 2.2 (Froyo) software update includes new enhancements to support Adobe&#34; Flash&#34; Player 10.1 (pre-installed), support for 720p video recording, and many other improvements for your DROID Incredible [...]]]></description>
			<content:encoded><![CDATA[<p>My wife&#8217;s Droid Incredible received the Froyo update notice today. Interestingly it mentions Flash Player in the update text. Here is some highlights from the text: &#8220;This Android&#8482; 2.2 (Froyo) software update includes new enhancements to support Adobe&#34; Flash&#34; Player 10.1 (pre-installed), support for 720p video recording, and many other improvements for your DROID Incredible by HTC.&#8221;<br />
<span id="more-661"></span><br />
Here is a picture of the full text of the update screen.</p>
<p><img src="http://renaun.com/blog/wp-content/uploads/2010/09/droidincrediblefroyo1.jpg" alt="" title="Droid Incredible Froyo Update" width="400" height="533" class="aligncenter size-full wp-image-663" /></p>
<p>After hitting the Restart and Install button the phone came back up with Froyo on the device and Flash Player (10.1.72.7) pre-installed. The Flash Player is not on this phone&#8217;s marketplace and will probably get updates through the devices update mechanism, since it was pre-installed. Originally the Droid Incredible had Flash Lite installed which with this update it is removed (the app shell is there but no app in Manage Applications). </p>
<p>You will see device creators, be it the manufacturer or the carriers, wanting to control the experiences of their devices, and this doesn&#8217;t leave out Flash Player. Either way you slice it though getting Flash Player in marketplaces of supported phones or having device creators pre-install it on the device is a great thing for Flash.</p>
<p>Here is a picture of flash on the device:<br />
<img src="http://renaun.com/blog/wp-content/uploads/2010/09/droidwithflash.jpg" alt="" title="droidwithflash" width="480" height="640" class="aligncenter size-full wp-image-665" /></p>
                <p><center>&copy; %FIRST Erickson &#8211; visit the <a href="http://www.renaun.com">&lt;renaun.com:flexblog text=&#8221;{ ModelLocator.myThoughts }&#8221;/&gt;</a> </center></p>            ]]></content:encoded>
			<wfw:commentRss>http://renaun.com/blog/2010/09/droid-incredible-update-to-froyo-with-flash-player-in-the-update/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flex Hero -size-report added to mxmlc</title>
		<link>http://renaun.com/blog/2010/09/flex-hero-size-report-added-to-mxmlc/</link>
		<comments>http://renaun.com/blog/2010/09/flex-hero-size-report-added-to-mxmlc/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 08:51:10 +0000</pubDate>
		<dc:creator>Renaun Erickson</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://renaun.com/blog/?p=652</guid>
		<description><![CDATA[This is actually a very cool feature that is being added in Flex Hero. You can check the specification wiki page for SWF Size Report here. Previously all we had was the link-report which gave us a bunch of information about classes and inheritance and a rough idea of compressed size of classes. It was [...]]]></description>
			<content:encoded><![CDATA[<p>This is actually a very cool feature that is being added in Flex Hero. You can check the specification wiki page for <a href="http://opensource.adobe.com/wiki/display/flexsdk/Size+Report">SWF Size Report here</a>. Previously all we had was the link-report which gave us a bunch of information about classes and inheritance and a rough idea of compressed size of classes. It was helpful to see which classes relative to each other where taking up space in a specific SWF file. But where the SWF Size Report comes in to play is it provides a nice breakdown of the SWF&#8217;s uncompressed size for actually bytes in the SWF.<br />
<span id="more-652"></span><br />
The SWF Size Report breakdown gives you a detailed view of which classes, assets, fonts, binaryData, etc&#8230; make up the bytes of the SWF. I started creating an AIR application that would help visualize this data (see image below). This has been done in the past by other community people for the link report data. I don&#8217;t know if/when I&#8217;ll finish up the AIR application, but hopefully the community will pick this idea up and run with it as it really useful in optimizing SWF sizes.</p>
<p><img src="http://renaun.com/blog/wp-content/uploads/2010/09/Picture-24.png" alt="" title="SWFSizeReportViewer" width="421" height="337 class="aligncenter size-full wp-image-653" /></p>
                <p><center>&copy; %FIRST Erickson &#8211; visit the <a href="http://www.renaun.com">&lt;renaun.com:flexblog text=&#8221;{ ModelLocator.myThoughts }&#8221;/&gt;</a> </center></p>            ]]></content:encoded>
			<wfw:commentRss>http://renaun.com/blog/2010/09/flex-hero-size-report-added-to-mxmlc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flex Hero RSL Enhancements and Monkey Patching</title>
		<link>http://renaun.com/blog/2010/08/flex-hero-rsl-enhancements-and-monkey-patching/</link>
		<comments>http://renaun.com/blog/2010/08/flex-hero-rsl-enhancements-and-monkey-patching/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 20:35:05 +0000</pubDate>
		<dc:creator>Renaun Erickson</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://renaun.com/blog/?p=627</guid>
		<description><![CDATA[In my last post "Using Flex Hero RSL Enhancements" I discussed some of the new Flex Hero features around RSL Enhancements. I wanted to finish off the discussion with some information about the new "include-inheritance-dependencies-only" addition to compc, which added to make monkey patching with RSL's easier. Lets just say it made one manual step [...]]]></description>
			<content:encoded><![CDATA[<p>In my last post "<a href="http://renaun.com/blog/2010/08/using-flex-hero-rsl-enhancements/">Using Flex Hero RSL Enhancements</a>" I discussed some of the new Flex Hero features around <a href="http://opensource.adobe.com/wiki/display/flexsdk/RSL+Enhancements">RSL Enhancements</a>. I wanted to finish off the discussion with some information about the new "include-inheritance-dependencies-only" addition to compc, which added to make monkey patching with RSL's easier. Lets just say it made one manual step easier, the whole process is still a bit complex. </p>
<p>The main goal of Runtime Shared Libraries (RSL) and monkey patching is to be able to leverage the Adobe official RSL's with custom RSL's that only include the few classes that you are changing. This means you need to understand what classes are in what official libraries.</p>
<p>There is a bunch of information on RSL's and monkey patching explaining the more manual way of figuring out the exact classes you wanted in your monkey patched RSL. It involves a bunch of getting what classes to include and exclude from different compiles of mxmlc and compc. Here is a good resource on the subject over at <a href="http://blogs.adobe.com/dloverin/">Darrell Loverin's blog</a>. I need to give a shout out to Darrell for helping me work through the new feature and how to make this all work in Flash Builder 4. Which is the approach I wanted to try and make work instead of the more common method of build scripts. Some parts of the Flash Builder 4 approach might change in the future as the IDE changes, and some parts are easier with using custom <code>flex-config.xml</code> and ANT builds. But if you don't know or have an ANT setup or don't know about <code>flex-config.xml</code> it doesn't make a difference and I wanted to show how to do it without all that.<br />
<span id="more-627"></span><br />
<strong>Source Code Used in the Post</strong></p>
<p><a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+Hero">Flex Hero SDK</a><br />
<a href="http://renaun.com/flex4/RSLCommon.fxpl">RSLCommon.fxpl</a><br />
<a href="http://renaun.com/flex4/RSLPatchHero.fxpl">RSLPatchHero.fxpl</a><br />
<a href="http://renaun.com/flex4/RSLTestHeroMonkeyPatch.fxp">RSLTestHeroMonkeyPatch.fxp</a></p>
<p>The three Flex projects included above are the main Flex project "<code>RSLTestHeroMonkeyPatch</code>" and two Flex Library projects "<code>RSLCommon</code>" and "<code>RSLPatchHero</code>". The <code>RSLPatchHero</code> is where the monkey patch class is and the <code>RSLCommon</code> holds the <code>com.renaun.preloader.TimedPreloader</code> class from the previous post (which provides us with a way to see RSL load ordering). Now for the fun stuff.</p>
<p><strong><code>RSLPatchHero</code> and creating a Monkey Patched RSL</strong></p>
<p>For the monkey patching I created the <code>RSLPatchHero</code> Flex Library project. Then copied the <code>spark.components.Button</code> class from the Flex Hero SDK. Opening up the <code>spark.components.Button</code> class I added my code patch by adding an override method of the <code>label</code> setter, see below:</p>
<div class="syntax_hilite">
<div id="actionscript-3">
<div class="actionscript">override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> label<span style="color: #66cc66;">&#40;</span>value:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// label property is just a proxy to the content.</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// The content setter will dispatch the event.</span><br />
&nbsp; &nbsp; content = <span style="color: #ff0000;">"Monkey Patched FlexHero: "</span> + value;<br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></p>
<p>There will be some compile errors because the ButtonIcon in the metadata and the Version.as file are not in my source path. I went ahead and commentted these out, alternatively I should have copied the files over to the project with the right paths. Now that I have a monkey patched spark <code>Button</code> I need to get the compiling right. Lets first check out the defaults. With the Flex SDK defaulting to "Use default(external)" linking of the framework libraries and adding a compiler argument to output a link report I find out that the swc only includes our custom <code>Button</code> class and a bunch of "external-defs" (see link.rpt).</p>
<p><img src="http://renaun.com/blog/wp-content/uploads/2010/08/Picture-9.png" alt="" title="Flex Hero SDK default library linking" width="282" height="74" class="aligncenter size-full wp-image-629" /></p>
<p><em>NOTE: Let me step back and try and give the context of libraries and the complexity of linking. The main goal is to figure out the exact amount of classes needed allow for loading of those classes before any other class by the same name (as first loaded rules). Next figuring out what classes are in which libraries to figure out ordering of library loading. We can't just have a swc with <code>Button</code> in it because its based on <code>ButtonBase</code>, and if we want our swc to load before the <code>spark.swc</code>, which is where <code>ButtonBase</code> is we need to make sure <code>ButtonBase</code> is in our custom swc. But any classes that <code>Button</code> use that are in <code>framework.swc</code> can be linked externally because it can be loaded first. Depending on how much monkey patching you are doing be aware of these kind of relationships. There is a <code>swcdepends</code> tool in the Flex SDK that can help with this.</em></p>
<p>Now to get the classes that the custom <code>Button</code> class depend on into the swc I needed to merge the libraries into the project instead of using the default external linking setting. </p>
<p><img src="http://renaun.com/blog/wp-content/uploads/2010/08/Picture-10.png" alt="" title="Flex SDK Hero with Merged into code" width="283" height="74" class="aligncenter size-full wp-image-631" /></p>
<p>With the merged link type on I looked at the <code>link.rpt</code>. What I found was the swc included a bunch of classes. By comparison this project with "Merged into code" setting:</p>
<ul>
<li>Flex 4 SDK - 600kb</li>
<li>Flex Hero SDK - 361kb</li>
</ul>
<p>The difference is in the fact that with Flex Hero the <code>framework.swc</code> was separated into two swc's, <code>framework.swc</code> and <code>mx.swc</code>. The next step is to use the new Flex Hero feature <code>-include-inheritance-dependencies-only</code>. Go into the project's properties -> Flex Compiler -> Additional compiler arguments input box and add <code>-include-inheritance-dependencies-only</code>. The result now is:</p>
<ul>
<li>Flex 4 SDK - 600kb</li>
<li>Flex Hero SDK - 361kb</li>
<li>Flex Hero SDK - 85kb (with -include-inheritance-dependencies-only)</li>
</ul>
<p>Cool now the swc only has the classes that have to be around for <code>Button</code> to work. Looking at the <code>link.rpt</code> I discovered there are classes from <code>spark.swc</code> and <code>framework.swc</code> that are included into the custom swc. Now I know that I want the <code>framework.swc</code> classes to be loaded through the official framework RSL, and since my monkey patched <code>Button</code> class is a spark component it has to be before the <code>spark.swc</code> RSL. This means I can go tell <code>framework.swc</code> to not be merged into my custom swc. This also tells me the ordering in which the RSL's have to be loaded: <code>framework.swc</code>, <code>RSLPatchHero.swc</code>, and then <code>spark.swc</code>. First lets remove <code>framework.swc</code> classes from the custom swc by opening project properties -> Flex Build Path -> Libraries tab -> then opening to the Link Type of the <code>framework.swc</code>, shown below in the image:</p>
<p><img src="http://renaun.com/blog/wp-content/uploads/2010/08/Picture-11.png" alt="" title="Link Type for framework.swc" width="529" height="247" class="aligncenter size-full wp-image-632" /></p>
<p>Select the Link Type row and click the Edit button. Now uncheck the "Use the same linkage as framework" and then select Link Type of External. Now the custom swc will only hold the needed classes from all the libraries beside framework.swc. This creates a swc size of only 16kb.</p>
<ul>
<li>Flex 4 SDK - 600kb</li>
<li>Flex Hero SDK - 361kb</li>
<li>Flex Hero SDK - 85kb (with -include-inheritance-dependencies-only)</li>
<li>Flex Hero SDK - 16kb (with -include-inheritance-dependencies-only and optimized library linking)</li>
</ul>
<p><strong>Using the <code>RSLPatchHero</code> in an application and RSL Load Ordering</strong></p>
<p>I created a <code>RSLTestHeroMonkeyPatch</code> project and added references to both the <code>RSLPatchHero</code> and <code>RSLCommon</code> Flex Library projects. The main application is just a default spark Application with a single spark Button:</p>
<div class="syntax_hilite">
<div id="xml-4">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">"utf-8"</span>?<span style="font-weight: bold; color: black;">&gt;</span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;s</span>:Application xmlns:<span style="color: #000066;">fx</span>=<span style="color: #ff0000;">"http://ns.adobe.com/mxml/2009"</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; xmlns:<span style="color: #000066;">s</span>=<span style="color: #ff0000;">"library://ns.adobe.com/flex/spark"</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; xmlns:<span style="color: #000066;">mx</span>=<span style="color: #ff0000;">"library://ns.adobe.com/flex/mx"</span> <span style="color: #000066;">minWidth</span>=<span style="color: #ff0000;">"955"</span> <span style="color: #000066;">minHeight</span>=<span style="color: #ff0000;">"600"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #000066;">preloader</span>=<span style="color: #ff0000;">"com.renaun.preloader.TimedPreloader"</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;fx</span>: Declarations<span style="font-weight: bold; color: black;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Place non-visual elements (e.g., services, value objects) here --&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/fx</span>: Declarations<span style="font-weight: bold; color: black;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;s</span>:Button <span style="color: #000066;">label</span>=<span style="color: #ff0000;">"Test Button"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/s</span>:Application<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</div>
</div>
<p></p>
<p>If you run the application right now without any changes it will not show the monkey patched spark <code>Button</code> because it loads the <code>RSLPatchHero</code> RSL last. I know the ordering needs to be <code>framework.swc</code>, <code>RSLPatchHero.swc</code>, and then <code>spark.swc</code>. Its kind of a process to make this work in Flash Builder 4, here are my steps I followed (and the ordering of these steps are important):</p>
<ol>
<li>Navigate to project properties -> Flex Build Path -> Library Path</li>
<li>Made all the libraries load as RSL (except RSLCommon).</li>
<li>Deselected the "Automatically determine library ordering based on dependencies" check box.</li>
<li>Select Flex 4.5 and hit the Remove button</li>
<li>Repeat these sub-steps for <code>framework.swc</code>, <code>textLayout.swc</code>, <code>RSLPatchHero</code> library (use Add Project instead of Add SWC), and <code>spark.swc</code>
<ol>
<li>
Click on "Add SWC..." button and added the framework.swc directly from its location in the Flex Hero SDK ($FLEX_HOME/framework/libs/framework.swc)</li>
<li>Select framework.swc library, expand and select Link Type, then hit Edit</li>
<li>In popup set Link Type to "Runtime shared library (RSL)"</li>
<li>Select "Digests (recommend)" and hit the "Add..." button</li>
<li>Keep defaults and click "Ok". <strong><em>NOTE: For production builds you'll want to come back in an added the proper policy file URL's for both the offical RSL's and roll over values. These can be found in the corresponding Flex SDK's flex config.xml. But since Flex Hero is not official there is no live official RSL's to use.</em></strong></li>
</ol>
</li>
<li>Click on the "Add Flex SDK" button</li>
<li>Expand the Flex 4.5 library and remove <code>framework.swc</code>, <code>spark.swc</code>, and <code>textLayout.swc</code></li>
<li>Selecting the libraries move them up and down to have an order as seen in the picture below.</li>
</ol>
<p>Here is the picture of what the final settings of the project are:<br />
<img src="http://renaun.com/blog/wp-content/uploads/2010/08/Picture-13.png" alt="" title="Flex Project RSL Ordering" width="533" height="455" class="aligncenter size-full wp-image-640" /></p>
<p>At this point the Flex project will run and display the monkey patched <code>Button</code>. Download the source projects and give it a try for yourself.</p>
                <p><center>&copy; %FIRST Erickson - visit the <a href="http://www.renaun.com">&lt;renaun.com:flexblog text="{ ModelLocator.myThoughts }"/&gt;</a> </center></p>            ]]></content:encoded>
			<wfw:commentRss>http://renaun.com/blog/2010/08/flex-hero-rsl-enhancements-and-monkey-patching/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using Flex Hero RSL Enhancements</title>
		<link>http://renaun.com/blog/2010/08/using-flex-hero-rsl-enhancements/</link>
		<comments>http://renaun.com/blog/2010/08/using-flex-hero-rsl-enhancements/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 21:29:56 +0000</pubDate>
		<dc:creator>Renaun Erickson</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[custom preloader]]></category>
		<category><![CDATA[hero]]></category>
		<category><![CDATA[rsl]]></category>

		<guid isPermaLink="false">http://renaun.com/blog/?p=617</guid>
		<description><![CDATA[One of the new features of the Flex Hero SDK is RSL Enhancements. I wanted to understand what this new feature really means for Flex projects and applications. The following post will show the differences in Flash Builder 4 projects and then use a custom Flex 4 preloader to display timed text information about what [...]]]></description>
			<content:encoded><![CDATA[<p>One of the new features of the <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+Hero">Flex Hero SDK</a> is <a href="http://opensource.adobe.com/wiki/display/flexsdk/RSL+Enhancements">RSL Enhancements</a>. I wanted to understand what this new feature really means for Flex projects and applications. The following post will show the differences in Flash Builder 4 projects and then use a custom Flex 4 preloader to display timed text information about what really is going on in the RSL loading process.<br />
<span id="more-617"></span><br />
<strong>Source Code Used in the Post</strong><br />
<a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+Hero">Flex Hero SDK</a><br />
<a href="http://renaun.com/flex4/RSLTest4_0.fxp">RSLTest4_0.fxp</a><br />
<a href="http://renaun.com/flex4/RSLTestHero.fxp">RSLTestHero.fxp</a></p>
<p><strong>Content</strong></p>
<p>If you haven't read the RSL Enhancements Flex SDK specification page here is the quick summary. The new features allows for you to set a compiler arguments for mxmlc to control rsl loading, be it forcing a rsl to load or ignore unused rsl's. And for compc you can set a compiler option to include only the inheritance dependencies of a set of classes specified in the include-classes option. This allows for monkey-patched classes to be delivered as rsl patches on top of the signed rsl's instead of having to include the core code in your custom rsl. One last thing is the separation of the framework.swf (included mx components) rsl into two rsl's: framework.swf and mx.swf. This is an improvement for spark only projects.</p>
<p><strong>Flash Builder 4 Projects Differences</strong><br />
I created two projects, <code>RSLTest4_0</code> and <code>RSLTestHero</code>, one pointing to Flex 4 SDK and the other Flex Hero SDK. They are the default Flex application with nothing in it. I had to switch Flex Hero SDK's build options to use RSL (currently the default is on to merge which is not necessarily how it will ship). Once both projects where build with default applications and RSL on the Flex SDK turned on this is what you see:</p>
<p><img src="http://renaun.com/blog/wp-content/uploads/2010/08/mxnotinframeworkrsl.png" alt="" title="MX not in Framework RSL" width="500" height="367" class="aligncenter size-full wp-image-618" /></p>
<p>You'll see that in the <code>RSLTestHero</code> project the new mx rsl is there (the highlighted one). </p>
<p>Ok that part of the feature is verified. Now to test the new compiler argument of <code>-remove-unused-rsls=true</code>. First you need to open up the <code>RSLTestHero</code> project's properties panel and add in the Flex Compiler -> Compiler options section the new compiler argument. See below for a picture of what I am talking about:</p>
<p><img src="http://renaun.com/blog/wp-content/uploads/2010/08/unusedrslarg.png" alt="" title="Remove Unused RSL Argument" width="403" height="208" class="aligncenter size-full wp-image-621" /></p>
<p>Now this doesn't actually remove the rsl's from the bin-debug folder. This leaves us with no real way to test what changes are going on, hence the need for a custom preloader to get to the meat of it.</p>
<p><strong>Custom Flex 4 Preloader - <code>com.renaun.preloader.TimedPreloader</code></strong><br />
I have included the source code for the custom Flex 4 preloader that I created. It basically reports event information based on time (<code>getTimer()</code>) relative to the <code>initialize()</code> call on preloader. Flex preloaders give you all kinds of information about the swf, rsl loading process, and validation of the initialize phases. The custom preloader display text on the screen (as well as sends traces out). Hooking into the relevant information and spitting it out, this is what the trace statements look like:</p>
<p><strong><code>RSLTestHero</code> with <code>-remove-unused-rsls=true</code></strong></p>
<pre>[117] Progress: 162324/327144
[SWF] Users:renaun:Documents:workspaces:BlogProjects:RSLTestHero:bin-debug:RSLTestHero.swf:[[DYNAMIC]]:1 - 650,777 bytes after decompression
[174] Progress: 327144/327144
[177] RSL Complete: 1/3 Bytes: 263124
file:///Users/renaun/Documents/workspaces/BlogProjects/RSLTestHero/bin-debug/textLayout_1.1.0.604.swf
[185] Progress: 425448/852844
[SWF] Users:renaun:Documents:workspaces:BlogProjects:RSLTestHero:bin-debug:RSLTestHero.swf:[[DYNAMIC]]:2 - 1,185,241 bytes after decompression
[SWF] Users:renaun:Documents:workspaces:BlogProjects:RSLTestHero:bin-debug:RSLTestHero.swf - 144,240 bytes after decompression
[278] Progress: 852844/852844
[279] RSL Complete: 2/3 Bytes: 525700
file:///Users/renaun/Documents/workspaces/BlogProjects/RSLTestHero/bin-debug/framework_4.5.0.17077.swf
[SWF] Users:renaun:Documents:workspaces:BlogProjects:RSLTestHero:bin-debug:RSLTestHero.swf:[[DYNAMIC]]:3 - 1,705,612 bytes after decompression
[405] Progress: 1468083/1468083
[407] RSL Complete: 3/3 Bytes: 615239
file:///Users/renaun/Documents/workspaces/BlogProjects/RSLTestHero/bin-debug/spark_4.5.0.17077.swf
[411] Progress: 1468083/1468083
[442] Progress: 1468083/1468083
[572] Complete
[573] Initialize Event #1
[610] Initialize Event #2
[640] Initialize Event #3
[670] Initialize Event #4</pre>
<p><br/><br />
<strong><code>RSLTestHero</code> with <code>-remove-unused-rsls=false</code></strong></p>
<pre>[103] Progress: 162665/284697
[110] Progress: 260969/284697
[SWF] Users:renaun:Documents:workspaces:BlogProjects:RSLTestHero:bin-debug:RSLTestHero.swf:[[DYNAMIC]]:1 - 529,577 bytes after decompression
[SWF] Users:renaun:Documents:workspaces:BlogProjects:RSLTestHero:bin-debug:RSLTestHero.swf - 145,017 bytes after decompression
[197] Progress: 284697/284697
[202] RSL Complete: 1/7 Bytes: 220336
file:///Users/renaun/Documents/workspaces/BlogProjects/RSLTestHero/bin-debug/osmf_1.0.0.16316.swf
[209] Progress: 383001/547821
[SWF] Users:renaun:Documents:workspaces:BlogProjects:RSLTestHero:bin-debug:RSLTestHero.swf:[[DYNAMIC]]:2 - 650,777 bytes after decompression
[299] Progress: 547821/547821
[302] RSL Complete: 2/7 Bytes: 263124
file:///Users/renaun/Documents/workspaces/BlogProjects/RSLTestHero/bin-debug/textLayout_1.1.0.604.swf
[SWF] Users:renaun:Documents:workspaces:BlogProjects:RSLTestHero:bin-debug:RSLTestHero.swf:[[DYNAMIC]]:3 - 1,185,241 bytes after decompression
[401] Progress: 1073521/1073521
[403] RSL Complete: 3/7 Bytes: 525700
file:///Users/renaun/Documents/workspaces/BlogProjects/RSLTestHero/bin-debug/framework_4.5.0.17077.swf
[412] Progress: 1171825/1601503
[423] Progress: 1368433/1601503
[SWF] Users:renaun:Documents:workspaces:BlogProjects:RSLTestHero:bin-debug:RSLTestHero.swf:[[DYNAMIC]]:4 - 1,143,269 bytes after decompression
[532] Progress: 1601503/1601503
[534] RSL Complete: 4/7 Bytes: 527982
file:///Users/renaun/Documents/workspaces/BlogProjects/RSLTestHero/bin-debug/mx_4.5.0.17077.swf
[544] Progress: 1699807/1809574
[SWF] Users:renaun:Documents:workspaces:BlogProjects:RSLTestHero:bin-debug:RSLTestHero.swf:[[DYNAMIC]]:5 - 443,950 bytes after decompression
[559] Progress: 1809574/1809574
[572] Progress: 1809574/1809574
[634] Progress: 1809574/1809574
[636] RSL Complete: 5/7 Bytes: 208071
file:///Users/renaun/Documents/workspaces/BlogProjects/RSLTestHero/bin-debug/rpc_4.5.0.17077.swf
[SWF] Users:renaun:Documents:workspaces:BlogProjects:RSLTestHero:bin-debug:RSLTestHero.swf:[[DYNAMIC]]:6 - 1,705,612 bytes after decompression
[787] Progress: 2424813/2424813
[789] RSL Complete: 6/7 Bytes: 615239
file:///Users/renaun/Documents/workspaces/BlogProjects/RSLTestHero/bin-debug/spark_4.5.0.17077.swf
[795] Progress: 2424813/2424813
[SWF] Users:renaun:Documents:workspaces:BlogProjects:RSLTestHero:bin-debug:RSLTestHero.swf:[[DYNAMIC]]:7 - 323,813 bytes after decompression
[839] Progress: 2494673/2494673
[841] RSL Complete: 7/7 Bytes: 69860
file:///Users/renaun/Documents/workspaces/BlogProjects/RSLTestHero/bin-debug/sparkskins_4.5.0.17077.swf
[857] Progress: 2494673/2494673
[878] Progress: 2494673/2494673
[991] Complete
[992] Initialize Event #1
[1025] Initialize Event #2
[1050] Initialize Event #3
[1080] Initialize Event #4
</pre>
<p><br/><br />
<strong><code>RSLTest4_0</code></strong></p>
<pre>[34] Progress: 161056/1099861
[110] Progress: 259360/1099861
[155] Progress: 849184/1099861
[SWF] Users:renaun:Documents:workspaces:BlogProjects:RSLTest4_0:bin-debug:RSLTest4_0.swf:[[DYNAMIC]]:1 - 2,292,131 bytes after decompression
[SWF] Users:renaun:Documents:workspaces:BlogProjects:RSLTest4_0:bin-debug:RSLTest4_0.swf - 142,610 bytes after decompression
[293] Progress: 1099861/1099861
[297] RSL Complete: 1/6 Bytes: 1037109
file:///Users/renaun/Documents/workspaces/BlogProjects/RSLTest4_0/bin-debug/framework_4.0.0.14159.swf
[SWF] Users:renaun:Documents:workspaces:BlogProjects:RSLTest4_0:bin-debug:RSLTest4_0.swf:[[DYNAMIC]]:2 - 370,463 bytes after decompression
[343] Progress: 1250592/1250592
[346] RSL Complete: 2/6 Bytes: 150731
file:///Users/renaun/Documents/workspaces/BlogProjects/RSLTest4_0/bin-debug/osmf_flex.4.0.0.13495.swf
[SWF] Users:renaun:Documents:workspaces:BlogProjects:RSLTest4_0:bin-debug:RSLTest4_0.swf:[[DYNAMIC]]:3 - 648,239 bytes after decompression
[420] Progress: 1512818/1512818
[422] RSL Complete: 3/6 Bytes: 262226
file:///Users/renaun/Documents/workspaces/BlogProjects/RSLTest4_0/bin-debug/textLayout_1.0.0.595.swf
[SWF] Users:renaun:Documents:workspaces:BlogProjects:RSLTest4_0:bin-debug:RSLTest4_0.swf:[[DYNAMIC]]:4 - 441,686 bytes after decompression
[472] Progress: 1720358/1720358
[475] RSL Complete: 4/6 Bytes: 207540
file:///Users/renaun/Documents/workspaces/BlogProjects/RSLTest4_0/bin-debug/rpc_4.0.0.14159.swf
[479] Progress: 1720358/1720358
[493] Progress: 1916966/2221609
[SWF] Users:renaun:Documents:workspaces:BlogProjects:RSLTest4_0:bin-debug:RSLTest4_0.swf:[[DYNAMIC]]:5 - 1,429,050 bytes after decompression
[576] Progress: 2221609/2221609
[577] RSL Complete: 5/6 Bytes: 501251
file:///Users/renaun/Documents/workspaces/BlogProjects/RSLTest4_0/bin-debug/spark_4.0.0.14159.swf
[SWF] Users:renaun:Documents:workspaces:BlogProjects:RSLTest4_0:bin-debug:RSLTest4_0.swf:[[DYNAMIC]]:6 - 323,414 bytes after decompression
[631] Progress: 2291414/2291414
[632] RSL Complete: 6/6 Bytes: 69805
file:///Users/renaun/Documents/workspaces/BlogProjects/RSLTest4_0/bin-debug/sparkskins_4.0.0.14159.swf
[643] Progress: 2291414/2291414
[661] Progress: 2291414/2291414
[792] Complete
[792] Initialize Event #1
[829] Initialize Event #2
[855] Initialize Event #3
[888] Initialize Event #4</pre>
<p><br/><br />
A few things here, you see that with the new compiler argument <code>RSLTestHero</code> only loads 3 rsl's intead of 7. Less RSL's to load mean faster load times! The Flex 4 sdk loaded 6 instead of the new 7 in Flex Hero with no unused rsl's where removed, which reflects the new mx.swf rsl. </p>
<p>Have fun playing with the new feature and try out the custom preloader on your own application to see what is really happening. I didn't show the compc dependency class listing feature here, but using the custom preloader is a great way to verify the monky-patching rsl's as they can now be dependent on other rsl.</p>
                <p><center>&copy; %FIRST Erickson - visit the <a href="http://www.renaun.com">&lt;renaun.com:flexblog text="{ ModelLocator.myThoughts }"/&gt;</a> </center></p>            ]]></content:encoded>
			<wfw:commentRss>http://renaun.com/blog/2010/08/using-flex-hero-rsl-enhancements/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
