<?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>SavageLook.com &#187; Flash Builder 4</title>
	<atom:link href="http://savagelook.com/blog/category/flash-builder-4/feed" rel="self" type="application/rss+xml" />
	<link>http://savagelook.com/blog</link>
	<description>Blowing your mind, one line of code at a time</description>
	<lastBuildDate>Wed, 18 Jan 2012 13:38:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>From Air for Android to Blackberry Playbook in seconds</title>
		<link>http://savagelook.com/blog/actionscript3/from-air-for-android-to-blackberry-playbook-in-seconds</link>
		<comments>http://savagelook.com/blog/actionscript3/from-air-for-android-to-blackberry-playbook-in-seconds#comments</comments>
		<pubDate>Mon, 21 Feb 2011 16:19:49 +0000</pubDate>
		<dc:creator>Tony Lukasavage</dc:creator>
				<category><![CDATA[ActionScript3]]></category>
		<category><![CDATA[Adobe Air]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Blackberry]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Flash Builder 4]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[playbook]]></category>

		<guid isPermaLink="false">http://savagelook.com/blog/?p=2418</guid>
		<description><![CDATA[How Adobe Air, fluid layouts, and Flex MXML skinning led to an effortless port from Android to the Blackberry Playbook<p><a href="http://savagelook.com/blog/actionscript3/from-air-for-android-to-blackberry-playbook-in-seconds">From Air for Android to Blackberry Playbook in seconds</a> is a post from: <a href="http://savagelook.com/blog">SavageLook.com</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><h1><span style="font-weight: bold; font-size: 16px;">Overview</span></h1>
<p style="text-align: center;"><a href="http://savagelook.com/blog/wp-content/uploads/2011/02/repper1.jpg" rel="shadowbox[sbpost-2418];player=img;"><img class="aligncenter size-large wp-image-2425" title="Repper for the Blackberry Playbook" src="http://savagelook.com/blog/wp-content/uploads/2011/02/repper1-1024x656.jpg" alt="Repper for the Blackberry Playbook" width="614" height="394" /></a></p>
<p style="text-align: left;"><strong>NOTE</strong>: all source code is available for <a href="https://github.com/tonylukasavage/Repper" target="_blank">Repper at Github</a>.</p>
<p style="text-align: left;">The above image shows my <a href="http://savagelook.com/blog/actionscript3/repper-my-first-flex-hero-mobile-app" target="_self">Air for Android app Repper</a> ported over to the Blackberry Playbook.  The most remarkable thing about this port? It literally took about 60 seconds to complete!  Here is the shockingly simple, comprehensive list of steps I took to accomplish this:</p>
<ol>
<li>Create a new Flex mobile project in <a href="http://labs.adobe.com/technologies/flashbuilder_burrito/" target="_blank">Flash Builder &#8220;Burrito&#8221;</a> to <a href="http://docs.blackberry.com/en/developers/deliverables/25068/Install_the_BlackBerry_Tablet_SDK_1347129_11.jsp" target="_blank">target the Blackberry Playbook</a></li>
<li>Copied the project files from my original Repper project to the new project</li>
<li>Set up the <a href="http://docs.blackberry.com/en/developers/deliverables/25068/Run_app_FB45_1397696_11.jsp" target="_blank">Playbook simulator run settings</a> in my new project</li>
<li>Clicked &#8220;Run&#8221; and voila, Repper on the Playbook!</li>
</ol>
<p style="text-align: left;">All components scaled properly.  All layouts fit to the available screen space appropriately.  All orientation transitions performed as expected.  How was this achieved without having to write a single line of device specific code?  It comes down to 3 simple things: Adobe Air, fluid layouts, and vector graphics skinning via Flex MXML.</p>
<h1><span style="font-weight: bold; font-size: 16px;">Adobe Air</span></h1>
<p style="text-align: left;">Blackberry&#8217;s use of the <a href="http://us.blackberry.com/developers/tablet/adobe.jsp" target="_blank">Adobe Air SDK for its Playbook development</a> lets Flash/Air/Flex/AS3 developers leverage existing expertise and code to create apps.  The Air SDK for the Playbook also makes available QNX components to give Playbook apps a Blackberry look and feel.  You can choose from either.  This way Flex developers can use their existing paradigms and pure AS3 developers can make use of Blackberry&#8217;s QNX components.  You can even use both as Renaun Erickson details in <a href="http://renaun.com/blog/2010/12/using-mxml-with-qnx-ui-components-for-the-playbook/" target="_blank">this post</a>.</p>
<p style="text-align: left;">For me the big win was taking Repper, a <a href="http://labs.adobe.com/technologies/flexsdk_hero/" target="_blank">Flex &#8220;Hero&#8221; </a> app for Android, and porting it directly, unchanged into a working Playbook app.  The Playbook Adobe Air SDK supports Flex &#8220;Hero&#8221; so everything just worked right out of the gate.  That&#8217;s the kind of portability that lets an independent developer be extremely productive.</p>
<h1><span style="font-weight: bold; font-size: 16px;">Fluid Layout</span></h1>
<p style="text-align: left;">Using fluid layouts with little to no defined pixel dimensions is key to writing a multi-screen app.  Take a look at this excerpt from the main <a href="https://github.com/tonylukasavage/Repper/blob/master/src/views/RepperHome.mxml" target="_blank">RepperHome.mxml view</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:HGroup</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;landscapeGroup&quot;</span> <span style="color: #000066;">includeIn</span>=<span style="color: #ff0000;">&quot;landscape&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span></span>
<span style="color: #009900;">			  <span style="color: #000066;">paddingTop</span>=<span style="color: #ff0000;">&quot;{this.height*0.03}&quot;</span> <span style="color: #000066;">paddingBottom</span>=<span style="color: #ff0000;">&quot;{this.height*0.03}&quot;</span> <span style="color: #000066;">paddingLeft</span>=<span style="color: #ff0000;">&quot;{this.height*0.03}&quot;</span></span>
<span style="color: #009900;">			  <span style="color: #000066;">paddingRight</span>=<span style="color: #ff0000;">&quot;{this.height*0.03}&quot;</span> <span style="color: #000066;">gap</span>=<span style="color: #ff0000;">&quot;{this.height*0.03}&quot;</span> <span style="color: #000066;">verticalAlign</span>=<span style="color: #ff0000;">&quot;middle&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:SkinnableContainer</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;landscapeInput&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;36%&quot;</span> <span style="color: #000066;">skinClass</span>=<span style="color: #ff0000;">&quot;RepperInputSkin&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:layout<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:VerticalLayout</span> <span style="color: #000066;">paddingTop</span>=<span style="color: #ff0000;">&quot;{this.height*0.06}&quot;</span> <span style="color: #000066;">paddingLeft</span>=<span style="color: #ff0000;">&quot;{this.height*0.06}&quot;</span> </span>
<span style="color: #009900;">								  <span style="color: #000066;">paddingRight</span>=<span style="color: #ff0000;">&quot;{this.height*0.06}&quot;</span> <span style="color: #000066;">paddingBottom</span>=<span style="color: #ff0000;">&quot;{this.height*0.06}&quot;</span> </span>
<span style="color: #009900;">								  <span style="color: #000066;">gap</span>=<span style="color: #ff0000;">&quot;{landscapeInput.height*0.04}&quot;</span> <span style="color: #000066;">horizontalAlign</span>=<span style="color: #ff0000;">&quot;right&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:layout<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:HGroup</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">verticalAlign</span>=<span style="color: #ff0000;">&quot;middle&quot;</span> <span style="color: #000066;">gap</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:Label</span> <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;Weight&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;65%&quot;</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;0x000000&quot;</span> <span style="color: #000066;">fontWeight</span>=<span style="color: #ff0000;">&quot;bold&quot;</span> <span style="color: #000066;">fontSize</span>=<span style="color: #ff0000;">&quot;32&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:TextInput</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;35%&quot;</span> <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;{inputWeight}&quot;</span> <span style="color: #000066;">keyUp</span>=<span style="color: #ff0000;">&quot;onWeightKeyUp(event)&quot;</span> <span style="color: #000066;">restrict</span>=<span style="color: #ff0000;">&quot;0-9.&quot;</span> </span>
<span style="color: #009900;">							 <span style="color: #000066;">contentBackgroundColor</span>=<span style="color: #ff0000;">&quot;0xffffff&quot;</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;0x000000&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:HGroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:HGroup</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">verticalAlign</span>=<span style="color: #ff0000;">&quot;middle&quot;</span> <span style="color: #000066;">gap</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> 
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:Label</span> <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;# of reps&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;65%&quot;</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;0x000000&quot;</span> <span style="color: #000066;">fontWeight</span>=<span style="color: #ff0000;">&quot;bold&quot;</span> <span style="color: #000066;">fontSize</span>=<span style="color: #ff0000;">&quot;32&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:TextInput</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;35%&quot;</span> <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;{inputReps}&quot;</span> <span style="color: #000066;">keyUp</span>=<span style="color: #ff0000;">&quot;onRepsKeyUp(event)&quot;</span> <span style="color: #000066;">restrict</span>=<span style="color: #ff0000;">&quot;0-9&quot;</span></span>
<span style="color: #009900;">							 <span style="color: #000066;">contentBackgroundColor</span>=<span style="color: #ff0000;">&quot;0xffffff&quot;</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;0x000000&quot;</span> <span style="color: #000066;">focusIn</span>=<span style="color: #ff0000;">&quot;textinput1_focusInHandler(event)&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:HGroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:Button</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Rep It&quot;</span> <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;recalculate();&quot;</span> <span style="color: #000066;">chromeColor</span>=<span style="color: #ff0000;">&quot;#111111&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:SkinnableContainer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;local:VDataGroup</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;32%&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">dataProvider</span>=<span style="color: #ff0000;">&quot;{repValues1}&quot;</span> <span style="color: #000066;">itemRenderer</span>=<span style="color: #ff0000;">&quot;RepperEntry&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;local:VDataGroup</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;32%&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">dataProvider</span>=<span style="color: #ff0000;">&quot;{repValues2}&quot;</span> <span style="color: #000066;">itemRenderer</span>=<span style="color: #ff0000;">&quot;RepperEntry&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:HGroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p style="text-align: left;">If you look at every component and container in this chunk of Flex MXML you&#8217;ll notice that no defined pixel dimensions are used.  Every component&#8217;s size is determined using percentages or data bindings.  I&#8217;m not going to lie, specifying dimensions in this manner will take more time and requires a bit of trial and error to get right.  It helps if you do it with the expectation that another, dissimilar device will be using this same layout in the future.  I did, and in this case the little bit of extra forethought paid off huge in terms of portability.</p>
<p>Because of design via fluid layouts, Repper appears properly in both portrait and landscape orientation on the Blackberry Playbook with no additional effort.</p>
<h1><span style="font-weight: bold; font-size: 16px;">Vector Graphics via Flex MXML Skinning</span></h1>
<p style="text-align: left;">The final factor that made Repper such a breeze to port to the Playbook was Flex Hero&#8217;s ability to create vector graphics via Flex MXML.  By utilizing this capability you can create skins for your components that scale as the app scales.  No external artwork of any kind is necessary.  While this is not ideal for designers or highly stylized apps, a developer like me loves it.  </p>
<p>Here&#8217;s another excerpt from Repper.  This time it shows how I used fluid dimensions once again to create vector graphic skins for my <a href="https://github.com/tonylukasavage/Repper/blob/master/src/RepperEntry.mxml" target="_blank">RepperEntry</a> components via the <a href="https://github.com/tonylukasavage/Repper/blob/master/src/RepperEntrySkin.mxml" target="_blank">RepperEntrySkin.mxml class</a></p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:Rect</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;background&quot;</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;{this.height/6}&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;66%&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">radiusX</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #000066;">radiusY</span>=<span style="color: #ff0000;">&quot;10&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:filters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:DropShadowFilter</span> <span style="color: #000066;">blurX</span>=<span style="color: #ff0000;">&quot;16&quot;</span> <span style="color: #000066;">blurY</span>=<span style="color: #ff0000;">&quot;16&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:filters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:stroke<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:SolidColorStroke</span> <span style="color: #000066;">weight</span>=<span style="color: #ff0000;">&quot;3&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:stroke<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:fill<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:LinearGradient</span> <span style="color: #000066;">rotation</span>=<span style="color: #ff0000;">&quot;-90&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:GradientEntry</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;#bbbbbb&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:GradientEntry</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;#ffffff&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:LinearGradient<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:fill<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:Rect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:Rect</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;{this.height/6}&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;66%&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;60%&quot;</span> <span style="color: #000066;">radiusX</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #000066;">radiusY</span>=<span style="color: #ff0000;">&quot;10&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:filters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:DropShadowFilter</span> <span style="color: #000066;">blurX</span>=<span style="color: #ff0000;">&quot;8&quot;</span> <span style="color: #000066;">blurY</span>=<span style="color: #ff0000;">&quot;8&quot;</span> <span style="color: #000066;">angle</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:filters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:stroke<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:SolidColorStroke</span> <span style="color: #000066;">weight</span>=<span style="color: #ff0000;">&quot;3&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:stroke<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:fill<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #808080; font-style: italic;">&lt;!--- @private --&gt;</span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:LinearGradient</span> <span style="color: #000066;">rotation</span>=<span style="color: #ff0000;">&quot;-90&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:GradientEntry</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;#000000&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:GradientEntry</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;#444444&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:LinearGradient<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #808080; font-style: italic;">&lt;!-- &lt;s:SolidColor color=&quot;#333333&quot;/&gt; --&gt;</span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:fill<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:Rect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>As you can see, percentages and binding are used to create skins for my components that are appropriately scaled regardless of the dimensions of the device.  Not having to create skin resources for each device and orientation is a tremendous time saver.  Especially for someone like myself who has no patience or talent for it.  </p>
<h1><span style="font-weight: bold; font-size: 16px;">Summary</span></h1>
<p>Lesson for the day: with a little forethought and a penchant for Adobe Air, magic can happen.  OK, maybe not magic, but you&#8217;ll have more time to explore the possibility of creating magic now that you won&#8217;t be wasting it on porting your mobile apps.  Yes, I know, I&#8217;ve griped a bit lately about Flex Hero on <a href="http://twitter.com/#!/tonylukasavage" target="_blank">twitter</a>, but there are undoubtedly some things it does very well.  </p>
<p>In fact, if you think about it, anyone that openly supports Adobe and their efforts to create a viable cross-platform mobile development environment has done very well with it.  I&#8217;m trying to think of who isn&#8217;t supporting it?  Who&#8217;s at the &#8220;core&#8221; of the issue?  I feel like day to day they are trying to keep the doctor away.  Supporting Adobe should be as appealing as American pie.  Oh well, hopefully some day they will have their thinking jolted like Isaac Newton did from a falling piece of fruit.  </p>
<p><a href="http://savagelook.com/blog/actionscript3/from-air-for-android-to-blackberry-playbook-in-seconds">From Air for Android to Blackberry Playbook in seconds</a> is a post from: <a href="http://savagelook.com/blog">SavageLook.com</a></p>
<div class="shr-publisher-2418"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://savagelook.com/blog/actionscript3/from-air-for-android-to-blackberry-playbook-in-seconds/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Video: Google Project, Flash Builder 4, and Subclipse</title>
		<link>http://savagelook.com/blog/flash-builder-4/video-google-project-flash-builder-4-and-subclipse</link>
		<comments>http://savagelook.com/blog/flash-builder-4/video-google-project-flash-builder-4-and-subclipse#comments</comments>
		<pubDate>Mon, 13 Sep 2010 12:36:28 +0000</pubDate>
		<dc:creator>Tony Lukasavage</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Flash Builder 4]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Version Control]]></category>
		<category><![CDATA[google project]]></category>
		<category><![CDATA[subclipse]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://savagelook.com/blog/?p=796</guid>
		<description><![CDATA[Here's the 2 part "Google Project, Subversion, and Eclipse" guide condensed into one easy to follow video.<p><a href="http://savagelook.com/blog/flash-builder-4/video-google-project-flash-builder-4-and-subclipse">Video: Google Project, Flash Builder 4, and Subclipse</a> is a post from: <a href="http://savagelook.com/blog">SavageLook.com</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/DYcEm2KCSeM?fs=1&amp;hl=en_US" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/DYcEm2KCSeM?fs=1&amp;hl=en_US" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>In my prior 2 part guide entitled &#8220;Google Project, Subversion, and Eclipse&#8221; (<a href="http://savagelook.com/blog/portfolio/google-project-subversion-and-eclipse-part-1" target="_self">Part 1</a> and <a href="http://savagelook.com/blog/portfolio/google-project-subversion-and-eclipse-part-1" target="_self">Part 2</a>) I discussed how to setup a Google Project Hosting Subversion repository and how to integrate it into an Eclipse based IDE.  It came with lots of text and screenshots.  While lots of people prefer this method of step by step instruction (I&#8217;m usually one of them), its layout left me disappointed.</p>
<p>To remedy this dissatisfaction I put together this video.  It walks you through everything from that 2 part guide in a concise 6 minute video.  You&#8217;ll get to see exactly how to create a Google Project Hosting Subversion repository, install the <a href="http://subclipse.tigris.org/" target="_blank">Subclipse SVN plugin</a> for Flash Builder 4, and integrate the repository into your development environment.</p>
<p>You&#8217;ll have to forgive the very amateur nature of the video, this was my first time using <a href="http://www.adobe.com/products/captivate/" target="_blank">Adobe Captivate</a> .  Its a pretty intuitive software, but I&#8217;m totally ignorant to the finer points of video guide creation.  I&#8217;m sure that will start to change in the near future, though, especially if people actually take the time to watch this one.</p>
<p><a href="http://savagelook.com/blog/flash-builder-4/video-google-project-flash-builder-4-and-subclipse">Video: Google Project, Flash Builder 4, and Subclipse</a> is a post from: <a href="http://savagelook.com/blog">SavageLook.com</a></p>
<div class="shr-publisher-796"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://savagelook.com/blog/flash-builder-4/video-google-project-flash-builder-4-and-subclipse/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Project, Subversion, and Eclipse, Part 2</title>
		<link>http://savagelook.com/blog/flash-builder-4/google-project-subversion-and-eclipse-part-2</link>
		<comments>http://savagelook.com/blog/flash-builder-4/google-project-subversion-and-eclipse-part-2#comments</comments>
		<pubDate>Sat, 11 Sep 2010 07:04:50 +0000</pubDate>
		<dc:creator>Tony Lukasavage</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Flash Builder 4]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Version Control]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[google project]]></category>
		<category><![CDATA[subclipse]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://savagelook.com/blog/?p=740</guid>
		<description><![CDATA[In Part 2, I show you how to integrate your Google Project Hosting repository into your Eclipse based IDE of choice using Subclipse.<p><a href="http://savagelook.com/blog/flash-builder-4/google-project-subversion-and-eclipse-part-2">Google Project, Subversion, and Eclipse, Part 2</a> is a post from: <a href="http://savagelook.com/blog">SavageLook.com</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>In <a href="http://savagelook.com/blog/portfolio/google-project-subversion-and-eclipse-part-1" target="_self">Part 1 of this guide</a> we learned how to setup a Google Project Hosting Subversion repository for version control and remote storage of our code.  In Part 2 we will learn how to integrate this remote repository into the Eclipse based IDE of your choice.  Before starting, though, let me first mention that:</p>
<ul>
<li>I&#8217;m on a Windows system with <a href="http://tortoisesvn.tigris.org/" target="_blank">TortoiseSVN</a>, so some of this will vary on other OSes.</li>
<li>I will be using Flash Builder 4 for this guide, but Flex Builder 3 and other Eclipse based IDEs are very similar.</li>
<li>You&#8217;ll need to know the workspace directory of your IDE, which will be referred to as WORKSPACE from now on.</li>
</ul>
<p>So let&#8217;s say I want to check out my Away3D Flash Builder 4 template project.</p>
<ol>
<li>The first thing I do is go to my Google Project Hosting page and find the Subversion URL for that project.  You can find my project hosting at <a href="http://code.google.com/p/savagelook/">http://code.google.com/p/savagelook/</a><br />
<a href="http://code.google.com/p/savagelook/"></a><a href="http://savagelook.com/blog/wp-content/uploads/2010/09/project_home2.jpg" rel="shadowbox[sbpost-740];player=img;"><img class="alignnone size-full wp-image-747" title="Google Project Hosting Home" src="http://savagelook.com/blog/wp-content/uploads/2010/09/project_home2.jpg" alt="Google Project Hosting Home" width="628" height="185" /></a></li>
<li>Goto &#8220;<strong>Source -&gt; Browse</strong>&#8221; and we&#8217;ll find the project I&#8217;m looking for under the trunk, &#8220;<strong>away3d_template_fb4</strong>&#8220;.  The path to that project is &#8220;<strong>trunk/away3d_templates/away3d_template_fb4</strong>&#8220;.  You&#8217;ll need this for the checkout later.<br />
<a href="http://savagelook.com/blog/wp-content/uploads/2010/09/path.jpg" rel="shadowbox[sbpost-740];player=img;"><img class="alignnone size-full wp-image-750" title="Path to our project" src="http://savagelook.com/blog/wp-content/uploads/2010/09/path.jpg" alt="Path to our project" width="570" height="418" /></a></li>
<li>Now its time to install <a href="http://subclipse.tigris.org/" target="_blank">Subclipse</a>, an SVN plugin for Eclipse based IDEs.  Open up Flash Builder 4 (or whatever Eclipse based IDE you are using).  Goto &#8220;<strong>Help -&gt; Install New Software&#8230;</strong>&#8220;</li>
<li>In the resulting dialog, enter the following URL in the &#8220;Work with&#8221; field: <strong>http://subclipse.tigris.org/update_1.6.x</strong><br />
Then click  &#8221;Add&#8221;.  You will be prompted for a name for the site.  Just call it &#8220;Subclipse&#8221;.  After you click OK you should get a dialog that looks like this:<br />
<a href="http://savagelook.com/blog/wp-content/uploads/2010/09/software.jpg" rel="shadowbox[sbpost-740];player=img;"><img class="alignnone size-full wp-image-756" title="Installing New software" src="http://savagelook.com/blog/wp-content/uploads/2010/09/software.jpg" alt="Installing New software" width="533" height="531" /></a></li>
<li>Check &#8220;Subclipse&#8221; then expand its choices.  Deselect &#8220;Subclipse Integration for Mylyn 3.x (Optional)&#8221; and &#8220;Subversion Revision Graph&#8221;.  Your list should look like this:<br />
<a href="http://savagelook.com/blog/wp-content/uploads/2010/09/list.jpg" rel="shadowbox[sbpost-740];player=img;"><img class="alignnone size-full wp-image-758" title="Software List" src="http://savagelook.com/blog/wp-content/uploads/2010/09/list.jpg" alt="Software List" width="583" height="203" /></a></li>
<li>From here just follow the steps for the Subclipse install.  If you need specific instructions to get Subclipse loaded in your Eclipse based IDE, use the <a href="http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA" target="_blank">Download and Install instructions from the Subclipse website</a>.  The IDE will restart (or you should do it manually) when the install finishes.</li>
<li>After Flash Builder 4 reopens, right click in the Package Explorer and select &#8220;<strong>Import</strong>&#8230;&#8221;.  From the resulting dialog expand &#8220;<strong>SVN</strong>&#8221; and select &#8220;<strong>Checkout Projects From SVN</strong>&#8220;.  click Next.<br />
<a href="http://savagelook.com/blog/wp-content/uploads/2010/09/svn-dialog.jpg" rel="shadowbox[sbpost-740];player=img;"><img class="alignnone size-full wp-image-761" title="svn dialog" src="http://savagelook.com/blog/wp-content/uploads/2010/09/svn-dialog.jpg" alt="svn dialog" width="513" height="542" /></a></li>
<li>Select the radio button next to &#8220;<strong>Create a new repository location</strong>&#8221; and click Next.</li>
<li>In the &#8220;<strong>URL</strong>&#8221; field, I will be entering the following URL: <strong>https://savagelook.googlecode.com/svn/trunk/away3d_templates/away3d_template_fb4</strong><br />
Notice that the root of the path is my Google Project Hosting root &#8220;<strong>https://savagelook.googlecode.com/svn</strong>&#8221; and that it ends with the path to my specific project &#8220;<strong>trunk/away3d_templates/away3d_template_fb4</strong>&#8221; as mentioned in Step 2. click Next.</li>
<li>Your IDE will return a list of files under this project, but we are checking out the whole thing so just select the top level choice (the full URL) and click Finish.  It will likely take a few moments to finish, depending on the size of your project.<br />
<a href="http://savagelook.com/blog/wp-content/uploads/2010/09/final.jpg" rel="shadowbox[sbpost-740];player=img;"><img class="alignnone size-full wp-image-762" title="checkout in eclipse" src="http://savagelook.com/blog/wp-content/uploads/2010/09/final.jpg" alt="checkout in eclipse" width="502" height="335" /></a></li>
<li>In your Package Explorer you should now have your Google Project Hosted code integrated into your Eclipse based IDE.  You can do a quick confirmation of this by seeing if there are little yellow icons indicating version control on your filenames.  Also, you can mouse-over any version controlled filename to see when it was last committed and by whom.<br />
<a href="http://savagelook.com/blog/wp-content/uploads/2010/09/loaded.jpg" rel="shadowbox[sbpost-740];player=img;"><img class="alignnone size-full wp-image-764" title="SVN loaded project" src="http://savagelook.com/blog/wp-content/uploads/2010/09/loaded.jpg" alt="SVN loaded project" width="542" height="234" /></a></li>
<li>Now let&#8217;s try a quick change and commit.  I&#8217;m going to add a sphere to my Away3D template, then commit the change back to the Google Project Hosting Subversion repository.  After I make the code changes, save, and run the application, the local repository will mark the files as changed.  Notice the little yellow bars have changed to black and white asterisks on changed files.<br />
<a href="http://savagelook.com/blog/wp-content/uploads/2010/09/codechange.jpg" rel="shadowbox[sbpost-740];player=img;"><img class="alignnone size-full wp-image-766" title="Code change" src="http://savagelook.com/blog/wp-content/uploads/2010/09/codechange.jpg" alt="Code change" width="638" height="192" /></a></li>
<li>To commit all my changes I am going to right click on the project root in the Package Explorer and goto &#8220;<strong>Team -&gt; Commit&#8230;</strong>&#8221;<br />
<a href="http://savagelook.com/blog/wp-content/uploads/2010/09/commit.jpg" rel="shadowbox[sbpost-740];player=img;"><img class="alignnone size-full wp-image-768" title="commit changes" src="http://savagelook.com/blog/wp-content/uploads/2010/09/commit.jpg" alt="commit changes" width="572" height="512" /></a></li>
<li>In the resulting dialog I am going to write a simple commit message to give a little info about the changes and then click OK.  Eclipse will execute the commit and when it is finished you will see all those little black and white asterisks turn back into yellow bars.  This signifies that your local changes have been successfully sent to the Google Project Hosting Subversion repository.  Feel free to go back to the Google project web interface to confirm it.<br />
<a href="http://savagelook.com/blog/wp-content/uploads/2010/09/bigone.jpg" rel="shadowbox[sbpost-740];player=img;"><img class="alignnone size-full wp-image-771" title="Commit through eclipse" src="http://savagelook.com/blog/wp-content/uploads/2010/09/bigone.jpg" alt="Commit through eclipse" width="410" height="460" /></a></li>
</ol>
<p>Congrats, you made it!  If you managed to follow along with these 2 long blog posts of mine, you now have your code hosted by Google Project Hosting in a Subversion repository and have it fully integrated into the Eclipse based IDE of your choice.  Give yourself a pat on the back!</p>
<p>It may seem like a lot of work up front, but the ability to revert, merge, backup, branch, and tag code becomes priceless once you get into some serious projects.  The simple assurance that you can fall back to a any revision of your code when you inevitably F something up is great.  Learn to love version control and I assure you it will love you back.  Creepy&#8230;</p>
<p><a href="http://savagelook.com/blog/flash-builder-4/google-project-subversion-and-eclipse-part-2">Google Project, Subversion, and Eclipse, Part 2</a> is a post from: <a href="http://savagelook.com/blog">SavageLook.com</a></p>
<div class="shr-publisher-740"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://savagelook.com/blog/flash-builder-4/google-project-subversion-and-eclipse-part-2/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Configure Flex SDK in Flash Builder 4</title>
		<link>http://savagelook.com/blog/flash-builder-4/configure-flex-sdk-in-flash-builder-4</link>
		<comments>http://savagelook.com/blog/flash-builder-4/configure-flex-sdk-in-flash-builder-4#comments</comments>
		<pubDate>Fri, 27 Aug 2010 18:06:59 +0000</pubDate>
		<dc:creator>Tony Lukasavage</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Flash Builder 4]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://savagelook.com/blog/?p=502</guid>
		<description><![CDATA[A quick guide to installing a new Flex SDK version in Flash Builder 4 <p><a href="http://savagelook.com/blog/flash-builder-4/configure-flex-sdk-in-flash-builder-4">Configure Flex SDK in Flash Builder 4</a> is a post from: <a href="http://savagelook.com/blog">SavageLook.com</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>OK, this is a pretty boring update to the blog, but I thought it might be useful to at least a handful of people.  Flash Builder 4 comes with a stock version of the Flex 3.5 and 4.0 SDKs.  If you are like me, though, you want the latest and greatest as soon as you can get your hands on it.  For that reason I put together this very short and simple explanation of how to install specific Flex SDKs for your Flash Builder 4.  For those familiar with Flex Builder 3, this will seem pretty familiar.</p>
<p>- <b>FLASH_BUILDER_4_HOME</b> is your Flash Builder 4 install path (i.e., C:\Program Files\Adobe\Flash Builder 4)<br />
- <b> SDK_VERSION</b> is the version number of your Flex SDK (i.e., 4.1.0)</p>
<ol>
<li>Get your desired Flex SDK from the <a href="http://opensource.adobe.com/wiki/display/flexsdk/Downloads" target="_blank">Flex SDK Download page</a>.
<p><div id="attachment_505" class="wp-caption alignnone" style="width: 427px"><a href="http://opensource.adobe.com/wiki/display/flexsdk/Downloads" target="_blank"><img class="size-full wp-image-505   " title="Flex SDK Download Page" src="http://savagelook.com/blog/wp-content/uploads/2010/08/flex_download.jpg" alt="" width="417" height="236" /></a><p class="wp-caption-text">Flex SDK Download Page</p></div></li>
<li>Unzip the archive to FLASH_BUILDER_4_HOME/sdks/SDK_VERSION</li>
<li>Open Flash Builder 4 and in the menu bar goto Windows -&gt; Preferences
<p><img class="alignnone size-full wp-image-511" title="Preferences" src="http://savagelook.com/blog/wp-content/uploads/2010/08/preferences.jpg" alt="" width="437" height="463" /></li>
<li>In the left pane of the Preferences window expand &#8220;Flash Builder&#8221; and click &#8220;Installed Flex SDKs&#8221;.  Click &#8220;Add&#8230;&#8221; in the right pane.
<p><img class="alignnone size-full wp-image-513" title="Installed Flex SDKs" src="http://savagelook.com/blog/wp-content/uploads/2010/08/installed_sdks.jpg" alt="" width="415" height="287" /></li>
<li>In the &#8220;Add Flex SDK&#8221; window enter the location of your new SDK (FLASH_BUILDER_4_HOME/sdks/SDK_VERSION) or click the &#8220;Browse..&#8221; button to find it yourself.  If you enter the path correctly, the &#8220;Flex SDK Name&#8221; field should auto-populate with the correct SDK name.
<p><img class="alignnone size-full wp-image-515" title="SDK Location" src="http://savagelook.com/blog/wp-content/uploads/2010/08/location.jpg" alt="" width="443" height="167" /></li>
<li>Click &#8220;OK&#8221; and your Flex SDK should be successfully installed.  You can now also set it as the default, if you wish, for all your future Flex projects.  Just click the checkbox next to the name of your SDK and click &#8220;Apply&#8221;.</li>
</ol>
<p>Even if you set up a new SDK as the default, there&#8217;s no reason you have to use it on all of your projects.  During the creation of a new Flex project you can specify which SDK you want to use in the &#8220;Flex SDK version&#8221; section.  You simply need to click the &#8220;Use a specific SDK&#8221; radio button and then select one of your installed SDKs from the drop down.  </p>
<p>You can also change the SDK after the project is created.  With your project selected, goto Project -> Properties and then click on &#8220;Flex Compiler&#8221; in the left pane.  On the right you&#8217;ll now see the same &#8220;Flex SDK version&#8221; section that was mentioned in the last paragraph.  Just change it and click &#8220;Apply&#8221;.</p>
<p>And thats about it.  Dig and have fun, Flash Builder 4 really is a fantastic IDE.</p>
<p><a href="http://savagelook.com/blog/flash-builder-4/configure-flex-sdk-in-flash-builder-4">Configure Flex SDK in Flash Builder 4</a> is a post from: <a href="http://savagelook.com/blog">SavageLook.com</a></p>
<div class="shr-publisher-502"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://savagelook.com/blog/flash-builder-4/configure-flex-sdk-in-flash-builder-4/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flash Builder 4: addElement() instead of addChild()</title>
		<link>http://savagelook.com/blog/actionscript3/flash-builder-4-addelement-instead-of-addchild</link>
		<comments>http://savagelook.com/blog/actionscript3/flash-builder-4-addelement-instead-of-addchild#comments</comments>
		<pubDate>Tue, 27 Jul 2010 12:56:08 +0000</pubDate>
		<dc:creator>Tony Lukasavage</dc:creator>
				<category><![CDATA[ActionScript3]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Flash Builder 4]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flex 4]]></category>

		<guid isPermaLink="false">http://savagelook.com/blog/?p=210</guid>
		<description><![CDATA[Here&#8217;s a quick tip for those of you who are also switching to Flex 4.x/Flash Builder 4 from Flex 3.x/Flex Builder 3.  In the past when you wanted to add a Flash DisplayObject to the main Application canvas you&#8217;d wrap the DisplayObject in a UIComponent, then add the UIComponent to the Application as a child, [...]<p><a href="http://savagelook.com/blog/actionscript3/flash-builder-4-addelement-instead-of-addchild">Flash Builder 4: addElement() instead of addChild()</a> is a post from: <a href="http://savagelook.com/blog">SavageLook.com</a></p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Here&#8217;s a quick tip for those of you who are also switching to Flex 4.x/Flash Builder 4 from Flex 3.x/Flex Builder 3.  In the past when you wanted to add a Flash DisplayObject to the main Application canvas you&#8217;d wrap the DisplayObject in a UIComponent, then add the UIComponent to the Application as a child, like this:</p>
<pre style="background:#cccccc;"><code style="color:#000000; font-weight:bold; font-size:1.1em;">var sprite:Sprite = new Sprite();
var ui:UIComponent = new UIComponent();
ui.addChild(sprite);
this.addChild(ui);</code></pre>
<p></p>
<p>Try that in Flash Builder 4 and you&#8217;ll encounter a fun error that looks like this:</p>
<pre style="background:#cccccc;"><code style="color:#000000; font-weight:bold; font-size:1.1em;">Error: addChild() is not available in this class. Instead, use
addElement() or modify the skin, if you have one.</code></pre>
<p></p>
<p>To resolve it, simply change the last line of the previous code to use addElement() instead (change in <span style="color: #ff0000;">red</span>):</p>
<pre style="background:#cccccc;"><code style="color:#000000; font-weight:bold; font-size:1.1em;">var sprite:Sprite = new Sprite();
var ui:UIComponent = new UIComponent();
ui.addChild(sprite);
<span style="color: #ff0000;">this.addElement(ui);</span></code></pre>
<p></p>
<p><a href="http://savagelook.com/blog/actionscript3/flash-builder-4-addelement-instead-of-addchild">Flash Builder 4: addElement() instead of addChild()</a> is a post from: <a href="http://savagelook.com/blog">SavageLook.com</a></p>
<div class="shr-publisher-210"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://savagelook.com/blog/actionscript3/flash-builder-4-addelement-instead-of-addchild/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
