<?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 &#187; AIR</title>
	<atom:link href="http://renaun.com/blog/category/air/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>Tue, 24 Jan 2012 01:30:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Customizing Flex applicationDPI for a multiple screen size application</title>
		<link>http://renaun.com/blog/2011/10/customizing-flex-applicationdpi-for-a-multiple-screen-size-application/</link>
		<comments>http://renaun.com/blog/2011/10/customizing-flex-applicationdpi-for-a-multiple-screen-size-application/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 15:32:12 +0000</pubDate>
		<dc:creator>Renaun Erickson</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[BlackBerry PlayBook]]></category>
		<category><![CDATA[Devices]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://renaun.com/blog/?p=1572</guid>
		<description><![CDATA[Building a Flex mobile application that works across smartphones and tablets takes an understanding of screen sizes, screen dots per inch (DPI) and screen resolutions. In the current landscape of devices typically you consider a tablet something bigger then a 5-6 inch physical screen. Also in the current device landscape screen resolutions are for tablets [...]]]></description>
			<content:encoded><![CDATA[<p>Building a Flex mobile application that works across smartphones and tablets takes an understanding of screen sizes, screen dots per inch (DPI) and screen resolutions. In the current landscape of devices typically you consider a tablet something bigger then a 5-6 inch physical screen. Also in the current device landscape screen resolutions are for tablets are typically greater then 1024x600 (original Galaxy Tab 7' and PlayBook), while smartphones are typically less 1024x600. This of course will change as screens get better and have high resolutions.</p>
<p>How Flex works with helping you develop and design for multiple screens is provide a concept of <code>applicationDPI</code>. This <code>applicationDPI</code> is baked into the spark mobile skins, available in css media queries, and available to you any where in your code. Flex also provides a mechanism to override the <code>applicationDPI</code> for your needs, I will get to this in a bit. First for an example of an application making heavy use of the <code>applicationDPI</code> check out <a href="http://renaun.com/blog/apps/caltraintimes/" title="Caltrain Times Mobile App">Caltrain Times</a>. It is currently running across Android, iOS, and BlackBerry Tablet OS (PlayBook). </p>
<p>I have also personally tested it across these devices:</p>
<table width="525" style="border: 1px solid #333333">
<tbody>
<tr style="background: #555555;color:#EEEEEE">
<th>Device Name</th>
<th style="text-align: center;">Screen Size</th>
<th style="text-align: center;">Screen Resolution</th>
<th style="text-align: center;">DPI</th>
</tr>
<tr>
<td>Motorola Atrix</td>
<td style="text-align: center;">4</td>
<td style="text-align: center;">540 x 960</td>
<td style="text-align: center;">275</td>
</tr>
<tr class="even">
<td>Google Nexus 1</td>
<td style="text-align: center;">3.7</td>
<td style="text-align: center;">480 x 800</td>
<td style="text-align: center;">254</td>
</tr>
<tr>
<td>iPhone 3GS</td>
<td style="text-align: center;">3.5</td>
<td style="text-align: center;">320 x 480</td>
<td style="text-align: center;">163</td>
</tr>
<tr class="even">
<td>iPod Retina Display</td>
<td style="text-align: center;">3.5</td>
<td style="text-align: center;">640 x 960</td>
<td style="text-align: center;">326</td>
</tr>
<tr>
<td>iPad</td>
<td style="text-align: center;">9.7</td>
<td style="text-align: center;">1024 x 768</td>
<td style="text-align: center;">132</td>
</tr>
<tr class="even">
<td>PlayBook</td>
<td style="text-align: center;">7</td>
<td style="text-align: center;">1024 x 600</td>
<td style="text-align: center;">168</td>
</tr>
<tr>
<td>Galaxy Tab 7'</td>
<td style="text-align: center;">7</td>
<td style="text-align: center;">1024 x 600</td>
<td style="text-align: center;">168</td>
</tr>
<tr class="even">
<td>Motorola Xoom</td>
<td style="text-align: center;">10.1</td>
<td style="text-align: center;">1280 x 800</td>
<td style="text-align: center;">150</td>
</tr>
<tr>
<td>Nook Color</td>
<td style="text-align: center;">7</td>
<td style="text-align: center;">1024 x 600</td>
<td style="text-align: center;">168</td>
</tr>
</tbody>
</table>
<p><strong>What is Flex's Application DPI really?</strong></p>
<p>Lets start with what its not. Its not a reflection of what the device's actual DPI, for example the DPI values in the above chart. What Flex does for developers is provide 3 classifications you build your application against. They values are 160, 240, and 320, but you can think of them as small, medium, and large. Its also important to think of the Flex three DPI classification approach as your way to define what your application looks like and how it acts not relative it directly to device DPI. I explain two examples of why this is important with my Caltrain Times application. First is how to handle incorrect DPI values from the OS level. Second is applying your look to a set of devices by customizing the DPI classification in Flex. I'll get to the detail of those two examples later in the article, first lets explain application DPI.</p>
<p>The definition, Flex's <code>applicationDPI</code> takes on two meanings. If you explicitly set the value your are telling Flex that this application is skin to <code>applicationDPI=XXX</code> (160,240, or 320) and for the application to automatically scale the SWF and contents to the ratio of XXX/<code>runtimeDPI</code>. The <code>applicationDPI</code> classification strings can be found in <code>mx.core.DPIClassification</code>. For more control of how your application looks for the different DPI's do not set this value. Then the value of <code>applicationDPI</code> is just a classification of 160, 240, or 320 (or some arbitrary value if you wanted to your own classification). By default Flex considers any device DPI of &lt; 200 = 160, &gt; 200 = 240 = &lt; 280, and &gt; 280 = 320. Now you can override the class <code>mx.core.RuntimeDPIProvider</code>, in the first case this controls the scaling, the second case it sets the <code>applicationDPI</code> value.</p>
<p>The rest of the post will make use of extending <code>mx.core.RuntimeDPIProvider</code> to handle incorrect DPIs from the OS and control the look between phones and tables.</p>
<p><strong>Handling Incorrect DPIs</strong></p>
<p>It just happens that on the <a href="http://renaun.com/blog/2011/03/air-2-6-capabilities-screendpi-on-devices/">Android devices depending on the OS and manufacturers there is a chance of the device reporting their DPI incorrectly</a>. I address this problem in Caltrain Times application, specifically on the Motorola Atrix, in my custom extended <code>mx.core.RuntimeDPIProvider</code> class. The basis of my thoughts go back to the current landscape screen resolution and screen size values. I check the resolution threshold of 1024x600=614400 and screen size to figure out case that just don't make sense. Here is the code for screenSize and pixel checking:</p>
<div class="igBar"><span id="lactionscript-4"><a href="#" onclick="javascript:showPlainTxt('actionscript-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ACTIONSCRIPT:</span>
<div id="actionscript-4">
<div class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> screenX:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">Capabilities</span>.<span style="color: #0066CC;">screenResolutionX</span>;<br />
<span style="color: #000000; font-weight: bold;">var</span> screenY:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">Capabilities</span>.<span style="color: #0066CC;">screenResolutionY</span>;<br />
<span style="color: #000000; font-weight: bold;">var</span> pixelCheck:<span style="color: #0066CC;">Number</span> = screenX * screenY;<br />
<span style="color: #000000; font-weight: bold;">var</span> pixels:<span style="color: #0066CC;">Number</span> = <span style="color: #66cc66;">&#40;</span>screenX*screenX<span style="color: #66cc66;">&#41;</span> + <span style="color: #66cc66;">&#40;</span>screenY*screenY<span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #000000; font-weight: bold;">var</span> screenSize:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">sqrt</span><span style="color: #66cc66;">&#40;</span>pixels<span style="color: #66cc66;">&#41;</span>/<span style="color: #0066CC;">Capabilities</span>.<span style="color: #0066CC;">screenDPI</span>;</div>
</div>
</div>
<p></p>
<p>In the case of a high resolution 4 inch Android device with incorrect DPI of < 220 you'll find that the screenSize is getting larger then 5 inches. In my application I just looked for any device that was larger then 4.3 screen size (might have to change that as phones get larger displays) and its screen resolution < 610000 with a report DPI of < 220. If all those criteria are found I force it to return a value of 240 which the correct value I want.</p>
<p>Here is the code (with some checks for the my desktop case in there too):</p>
<div class="igBar"><span id="lactionscript-5"><a href="#" onclick="javascript:showPlainTxt('actionscript-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ACTIONSCRIPT:</span>
<div id="actionscript-5">
<div class="actionscript"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>screenSize&gt; <span style="color: #cc66cc;">4</span>.<span style="color: #cc66cc;">3</span> &amp;&amp; pixelCheck&gt; <span style="color: #cc66cc;">510000</span> &amp;&amp; pixelCheck &lt;<span style="color: #cc66cc;">610000</span> &amp;&amp;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">Capabilities</span>.<span style="color: #0066CC;">screenDPI</span> &lt;<span style="color: #cc66cc;">240</span> &amp;&amp; pixelCheck != <span style="color: #cc66cc;">1296000</span><span style="color: #66cc66;">&#41;</span> <br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//trace(&quot;Force 240&quot;);</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> DPIClassification.<span style="color: #006600;">DPI_240</span>;<br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></p>
<p><em>Note: The source code can be found at <a href="https://github.com/renaun/CaltrainTimes/blob/master/src/com/renaun/mobile/dpi/CustomDPIProvider.as">https://github.com/renaun/CaltrainTimes/blob/master/src/com/renaun/mobile/dpi/CustomDPIProvider.as</a>.</em></p>
<p><strong>Applying your look to a set of devices by customizing the DPI classification in Flex</strong></p>
<p>In this example I use similar calculations to figure out if the device is of a tablet size. The reasoning for my Caltrain Times application is that I wanted to overrider the typical DPI classification of 160 for tablets to be rendered at the DPI classification of 240. For my application with the larger look on the bigger tablet screens it feels the screen out nicely and works well. Again I go into the custom runtime DPI class to do this. Here is the code:</p>
<div class="igBar"><span id="lactionscript-6"><a href="#" onclick="javascript:showPlainTxt('actionscript-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ACTIONSCRIPT:</span>
<div id="actionscript-6">
<div class="actionscript"><span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>screenSize&gt; <span style="color: #cc66cc;">6</span>.<span style="color: #cc66cc;">9</span> &amp;&amp; screenSize &lt;<span style="color: #cc66cc;">11</span> &amp;&amp; pixelCheck&gt; <span style="color: #cc66cc;">610000</span> &amp;&amp; pixelCheck &lt;<span style="color: #cc66cc;">1920000</span> &amp;&amp; pixelCheck != <span style="color: #cc66cc;">1296000</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//trace(&quot;Force 240 Tablet&quot;);</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> DPIClassification.<span style="color: #006600;">DPI_240</span>;&nbsp; &nbsp;<br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></p>
<p>The "<code>pixelCheck < 1920000 &#038;& pixelCheck != 1296000</code>" part is to handle running it through adl on my desktop. The rest probably makes sense, in the current device landscape tablets are typically larger then 7 inches and smaller then 11 inches with a resolution greater then 1024x600. If these values show up then I apply the DPI classification of 240.</p>
<p><strong>Summary</strong></p>
<p>The main take away is don't take the devices DPI at face value. If you want more control of your application across various devices make use of some classification constraints and check screen size, resolution, and DPI. It might seem like a bunch of work but this class can be used across applications and projects with minor tweaks depending on content requirements. Its also a good way to figure out if its a tablet or smartphone and outside of Flex DPI classification. Enjoy.</p>
<p>Check out my <a href="https://max.adobe.com/schedule/by-session/design-to-release-building-a-multi-screen-mobile-application-/S3641">MAX 2011 talk</a> where I go through Caltrain Times in more detail, as well as the source code available on <a href="http://github.com/renaun/CaltrainTimes">github.com/renaun/CaltrainTimes</a>.</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/2011/10/customizing-flex-applicationdpi-for-a-multiple-screen-size-application/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Applying styles to StyleableTextField with Flex CSS</title>
		<link>http://renaun.com/blog/2011/10/applying-styles-to-styleabletextfield-with-flex-css/</link>
		<comments>http://renaun.com/blog/2011/10/applying-styles-to-styleabletextfield-with-flex-css/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 15:41:41 +0000</pubDate>
		<dc:creator>Renaun Erickson</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Code / Slides]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://renaun.com/blog/?p=1527</guid>
		<description><![CDATA[The following code example comes from my experience in building the Caltrain Times mobile application. In the process of building out Caltrain Times I needed to convert some MXML item renders into ActionScript item renderers. I used some Flex CSS class selectors to change the look and feel for some labels based upon a selected [...]]]></description>
			<content:encoded><![CDATA[<p>The following code example comes from my experience in building the <a href="http://renaun.com/blog/apps/caltraintimes/" title="Caltrain Times Mobile App">Caltrain Times</a> mobile application. In the process of building out Caltrain Times I needed to convert some MXML item renders into ActionScript item renderers. I used some Flex CSS class selectors to change the look and feel for some labels based upon a selected state. I also had variations of font sizes in the Flex CSS class selectors based upon application dpi.</p>
<p>When going from MXML to ActionScript for item renderers or for performance reasons typically you use <code>StyleableTextField</code> instead of <code>Label</code>. <code>StyleableTextField</code> is a <code>TextField</code> with support for a subset of <code>Label</code> styles. StyleableTextField doesn't support styles through MXML or other typical fashions of the <code>Label</code> class. This means you typically to set the styles explicitly on the <code>StyleableTextField</code>, but then you have to know what styles are valid. There had to be another way. I didn't want to go through all the Flex CSS class properties I used in the MXML <code>Label</code> versions so I went looking for a solution to apply the styles through use of CSS class selectors. Now this is a solution and it works; but it might have performance implications for different types of content. In general it should work just fine if you are not changing the styles all the time.</p>
<p>Here is a screen shot of the item renderer with its selected state CSS changes.<br />
<div id="attachment_1546" class="wp-caption aligncenter" style="width: 331px"><a href="http://renaun.com/blog/wp-content/uploads/2011/10/itemrendererCSS.jpg"><img src="http://renaun.com/blog/wp-content/uploads/2011/10/itemrendererCSS.jpg" alt="" title="Caltrain Times CSS applied to ActionScript ItemRenderer" width="321" height="153" class="size-full wp-image-1546" /></a><p class="wp-caption-text">Caltrain Times CSS applied to ActionScript ItemRenderer</p></div></p>
<p><span id="more-1527"></span><br />
To start I needed to figure out how <code>StyleableTextField.getStyle()</code> works.</p>
<div class="igBar"><span id="lactionscript-10"><a href="#" onclick="javascript:showPlainTxt('actionscript-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ACTIONSCRIPT:</span>
<div id="actionscript-10">
<div class="actionscript"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">getStyle</span><span style="color: #66cc66;">&#40;</span>styleProp:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:*<br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// check out inline style first</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>_inlineStyleObject &amp;&amp; _inlineStyleObject<span style="color: #66cc66;">&#91;</span>styleProp<span style="color: #66cc66;">&#93;</span> !== <span style="color: #0066CC;">undefined</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> _inlineStyleObject<span style="color: #66cc66;">&#91;</span>styleProp<span style="color: #66cc66;">&#93;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// check styles that are on us via styleDeclaration</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>styleDeclaration &amp;&amp; styleDeclaration.<span style="color: #0066CC;">getStyle</span><span style="color: #66cc66;">&#40;</span>styleProp<span style="color: #66cc66;">&#41;</span> !== <span style="color: #0066CC;">undefined</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> styleDeclaration.<span style="color: #0066CC;">getStyle</span><span style="color: #66cc66;">&#40;</span>styleProp<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// if not inlined, check our style provider</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>styleName is IStyleClient<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> IStyleClient<span style="color: #66cc66;">&#40;</span>styleName<span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">getStyle</span><span style="color: #66cc66;">&#40;</span>styleProp<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// if can't find it, return undefined</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0066CC;">undefined</span>;<br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></p>
<p>This lets us know it first checks to see if there is a style assigned to the container object. This didn't work for me because I have multiple <code>StyleableTextField</code>s in the item renderer that needed different styles, as well as changing one of the <code>StyleableTextField</code>s dynamically. The class then checks for a styleDeclaration property, and if set it uses it to look up the style property value. This was the way I wanted to try out because I could use the Flex CSS class with out setting individual styles on objects.</p>
<p>The following code snippets are available in the <a href="https://github.com/renaun/CaltrainTimes/blob/master/src/com/renaun/caltrain/renderers/StationRendererAS.as">com.renaun.caltrain.renderers.StationRendererAS</a> file found in the <a href="http://github.com/renaun/CaltrainTimes">http://github.com/renaun/CaltrainTimes</a> repo.</p>
<p>Here is the initial setting of the <code>styleDeclaration</code> with the CSS class selector.</p>
<div class="igBar"><span id="lactionscript-11"><a href="#" onclick="javascript:showPlainTxt('actionscript-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ACTIONSCRIPT:</span>
<div id="actionscript-11">
<div class="actionscript">override protected <span style="color: #000000; font-weight: bold;">function</span> createChildren<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
<span style="color: #66cc66;">&#123;</span><br />
<span style="color: #808080; font-style: italic;">//...</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>!lblStation<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; lblStation = createLabelDisplay2<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; lblStation.<span style="color: #006600;">styleDeclaration</span> = styleManager.<span style="color: #006600;">getStyleDeclaration</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">".stationText1"</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; lblStation.<span style="color: #006600;">filters</span> = <span style="color: #66cc66;">&#91;</span>subtleDropShadow<span style="color: #66cc66;">&#93;</span>;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
<span style="color: #808080; font-style: italic;">//....</span><br />
<span style="color: #66cc66;">&#125;</span></p>
<p>protected <span style="color: #000000; font-weight: bold;">function</span> createLabelDisplay2<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:StyleableTextField<br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> lbl:StyleableTextField = StyleableTextField<span style="color: #66cc66;">&#40;</span>createInFontContext<span style="color: #66cc66;">&#40;</span>StyleableTextField<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; lbl.<span style="color: #006600;">editable</span> = <span style="color: #000000; font-weight: bold;">false</span>;<br />
&nbsp; &nbsp; lbl.<span style="color: #0066CC;">selectable</span> = <span style="color: #000000; font-weight: bold;">false</span>;<br />
&nbsp; &nbsp; lbl.<span style="color: #0066CC;">multiline</span> = <span style="color: #000000; font-weight: bold;">false</span>;<br />
&nbsp; &nbsp; lbl.<span style="color: #0066CC;">wordWrap</span> = <span style="color: #000000; font-weight: bold;">false</span>;<br />
&nbsp; &nbsp; lbl.<span style="color: #006600;">antiAliasType</span> = AntiAliasType.<span style="color: #006600;">ADVANCED</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; addChild<span style="color: #66cc66;">&#40;</span>lbl<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> lbl;<br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></p>
<p>Then to dynamically change the styles at runtime I do this:</p>
<div class="igBar"><span id="lactionscript-12"><a href="#" onclick="javascript:showPlainTxt('actionscript-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ACTIONSCRIPT:</span>
<div id="actionscript-12">
<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> selected<span style="color: #66cc66;">&#40;</span>value:<span style="color: #0066CC;">Boolean</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: #0066CC;">super</span>.<span style="color: #006600;">selected</span> = value;<br />
&nbsp; &nbsp; <br />
<span style="color: #808080; font-style: italic;">//...</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; lblStation.<span style="color: #006600;">styleChanged</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; lblStation.<span style="color: #006600;">styleDeclaration</span> = <br />
&nbsp; &nbsp; &nbsp; &nbsp; styleManager.<span style="color: #006600;">getStyleDeclaration</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"."</span>+<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>!value<span style="color: #66cc66;">&#41;</span> ? <span style="color: #ff0000;">"stationText1"</span> : <span style="color: #ff0000;">"stationText2"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; lblStation.<span style="color: #006600;">commitStyles</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</p>
<p><span style="color: #808080; font-style: italic;">//...</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; invalidateDisplayList<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></p>
<p>The <code>lblStation.styleChanged(null);</code> line of code sets the invalidateStyleFlag to true. This has to be done to allow styles to be set once <code>lblStation.commitStyles();</code> is called. </p>
<p>This approach provides you with the ability to set various Flex CSS class selectors for different StyleableTextFields in your ActionScript item renderers. As well as let you change them up when you want.</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/2011/10/applying-styles-to-styleabletextfield-with-flex-css/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hackathons Are Becoming Quite Popular</title>
		<link>http://renaun.com/blog/2011/09/hackathons-are-becoming-quite-popular/</link>
		<comments>http://renaun.com/blog/2011/09/hackathons-are-becoming-quite-popular/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 22:03:38 +0000</pubDate>
		<dc:creator>Renaun Erickson</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[BlackBerry PlayBook]]></category>
		<category><![CDATA[Devices]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[HTML5 / CSS]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://renaun.com/blog/?p=1510</guid>
		<description><![CDATA[I have seen an increase of mobile hackathons, hack days, and/or startup weekends in the last year. Typically the format runs over 1-3 day timeframe, where teams come together and code up a storm. Typically prizes are decent, people are friendly, and its a great way to learn new things. I would definitely recommend it [...]]]></description>
			<content:encoded><![CDATA[<p>I have seen an increase of mobile hackathons, hack days, and/or startup weekends in the last year. Typically the format runs over 1-3 day timeframe, where teams come together and code up a storm. Typically prizes are decent, people are friendly, and its a great way to learn new things. I would definitely recommend it to students are others looking to network or learn some new skills.</p>
<p>There are a couple that I wanted to point out since I am out west in Nevada and know the guys down in LA. </p>
<p><strong>This weekend:</strong></p>
<p><strong><a href="http://losangeles.mobilehackdays.com/rules-and-guidelines/">MobileHackDays LA - http://losangeles.mobilehackdays.com/</a></strong></p>
<p>Adobe is one of many sponsors for this event in LA running Sept 16-18th. I also know a team of Flash Platform developers that are attending as a team, "Team Adobe". Check out the guys from <a href="http://almerblank.com/">Almer|Blank</a> that are sure to <a href="http://labs.almerblank.com/2011/09/team-adobe-at-la-hack/">rock the event</a>.</p>
<div id="attachment_1511" class="wp-caption aligncenter" style="width: 490px"><a href="http://renaun.com/blog/wp-content/uploads/2011/09/image.jpg"><img src="http://renaun.com/blog/wp-content/uploads/2011/09/image.jpg" alt="" title="Team Adobe for MobileHackDays LA" width="480" height="320" class="size-full wp-image-1511" /></a><p class="wp-caption-text">Michael, Hasan, Omar, Nolan, Tim</p></div>
<p><strong><a href="http://recommerceday.com/">ReCommerce Hack Day - http://recommerceday.com/</a> </strong></p>
<p>Supported by the guys at Zappos.com. I will be checking this one out since its local.</p>
<p><strong>Other Thoughts</strong></p>
<p>There are others like this one in Las Vegas, NV, <a href="http://lasvegas.startupweekend.org/">Las Vegas Startup Weekend</a>. And a great website for both putting on a hackathon or getting info about other hackathons is <a href="http://hackatopia.com/">http://hackatopia.com/</a>. If you know of other mobile hack days or hackathon let me know below, I think its a great place for the community to get involved and learn a bunch.</p>
<p>Most of these you do not have to have a team to attend. They also usually encourage business, design, and developers to attend. Which makes for a great networking event as well. </p>
<p>If you do end up going to some of these events and build applications with Adobe products or the Flash Platform definitely let me know about it. Thanks, have fun hacking...</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/2011/09/hackathons-are-becoming-quite-popular/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Caltrain Times at MAX and Source Code</title>
		<link>http://renaun.com/blog/2011/09/caltrain-times-at-max-and-source-code/</link>
		<comments>http://renaun.com/blog/2011/09/caltrain-times-at-max-and-source-code/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 17:50:53 +0000</pubDate>
		<dc:creator>Renaun Erickson</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[BlackBerry PlayBook]]></category>
		<category><![CDATA[Code / Slides]]></category>
		<category><![CDATA[Devices]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://renaun.com/blog/?p=1498</guid>
		<description><![CDATA[I have been working on an application called Caltrain Times. It is available in quite a few marketplaces and runs across smartphones and tablets. I have made the source code for this application available on my github here. Adobe MAX is coming up in a few weeks and I will be speaking again at MAX. [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working on an application called <a href="http://renaun.com/blog/apps/caltraintimes/">Caltrain Times</a>. It is available in quite a few marketplaces and runs across smartphones and tablets. I have made the source code for this application available on my <a href="http://github.com/renaun/CaltrainTimes">github here</a>. </p>
<p><a href="http://max.adobe.com/">Adobe MAX</a> is coming up in a few weeks and I will be speaking again at MAX. There has been some last minute changes and I will not be speaking on my original topic of <a href="http://www.slideshare.net/renaun/digital-fun-for-the-digital-home">Digital Fun in the Digital Home</a>, but if you want to catch me talking about this topic come to the <a href="http://www.fitc.ca/events/presentations/presentation.cfm?event=118&#038;presentation_id=1680">SCREENS conference</a> later this year.</p>
<p>With the current focus on mobile development, I am excited to tell you what I will be talking about at MAX. I will be doing a detailed presentation about my process of building Caltrain Times across the different devices. </p>
<p><em>
<p style="padding-left: 20px"><strong>Title:</strong><br />
<a href="https://max.adobe.com/schedule/by-session/design-to-release-building-a-multi-screen-mobile-application-/S3641">Design to Release: Building a multi screen mobile application </a></p>
<p style="padding-left: 20px"><strong>Description:</strong><br />
Come learn how Caltrain Times was created using Photoshop, Fireworks, Flash Builder, AIR, and Flex. The application is released across the major marketplaces targeting smartphones and tablets across Android, iOS and BlackBerry PlayBook. The topics of workflow, testing, development, and releasing the application will be discussed in detail.</p>
<p></em></p>
<p>I will be covering the topic, not from a AIR/Flash Builder/Flex feature perspective, but from a higher level of how do get from start to finish with your mobile application. I will showcase the latest mobile features of Flash Builder and Flex as they played a critical role in different parts of my process. And this is not just development but the whole process, from design to release into the different mobile app stores. Come see me at MAX and definitely sign up for this <a href="https://max.adobe.com/schedule/by-session/design-to-release-building-a-multi-screen-mobile-application-/S3641">session</a> early.</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/2011/09/caltrain-times-at-max-and-source-code/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Flash Builder&#8217;s Mobile Workflow with Flash Professional Projects</title>
		<link>http://renaun.com/blog/2011/09/using-flash-builders-mobile-workflow-with-flash-professional-projects/</link>
		<comments>http://renaun.com/blog/2011/09/using-flash-builders-mobile-workflow-with-flash-professional-projects/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 19:18:24 +0000</pubDate>
		<dc:creator>Renaun Erickson</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://renaun.com/blog/?p=1452</guid>
		<description><![CDATA[Flash Professional and Flash Builder both have mobile workflows. If you want to use the mobile workflow of Flash Builder with a Flash Professional project take a look at the video at the end of the post. The basic idea is to use Flash Professional and/or Flash Professional Project type in Flash Builder as the [...]]]></description>
			<content:encoded><![CDATA[<p>Flash Professional and Flash Builder both have mobile workflows. If you want to use the mobile workflow of Flash Builder with a Flash Professional project take a look at the video at the end of the post.</p>
<p><a href="http://renaun.com/blog/wp-content/uploads/2011/09/Screen-shot-2011-09-13-at-10.56.49-AM.png"><img src="http://renaun.com/blog/wp-content/uploads/2011/09/Screen-shot-2011-09-13-at-10.56.49-AM.png" alt="" title="Flash Builder Projects" width="279" height="347" class="alignleft size-full wp-image-1491" /></a>The basic idea is to use Flash Professional and/or Flash Professional Project type in Flash Builder as the compilers. They compile the swf's, but do not handle the packaging of the mobile application. </p>
<p>Then you create a Flash Builder ActionScript Mobile Project that does the compiling and publishing out to mobile devices, with the compiling turned off. The compiler projects still put the debug symbols to allow debugging with the mobile project to work with full Flash Builder breakpoints and trace statement capabilities.</p>
<p>When you want to make a change, just make it in the Flash Professional Project in Flash Builder and it will compile the new swf to the ActionScript Mobile Project's bin-debug. Then you can launch it through the mobile project to test/debug.<br />
<span id="more-1452"></span><br />
<iframe src="http://player.vimeo.com/video/28999788?title=0&amp;byline=0&amp;portrait=0" width="400" height="300" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe>
<p><a href="http://vimeo.com/28999788">Using Flash Builder's Mobile Workflow with Flash Professional Projects</a> from <a href="http://vimeo.com/renaun">Renaun Erickson</a> on <a href="http://vimeo.com">Vimeo</a>.</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/2011/09/using-flash-builders-mobile-workflow-with-flash-professional-projects/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

