<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">

    <title type="text">David Ortinau</title>
    <subtitle type="text">David Ortinau:</subtitle>
    <link rel="alternate" type="text/html" href="http://www.davidortinau.com/blog/index/" />
    <link rel="self" type="application/atom+xml" href="http://www.davidortinau.com/blog/atom/" />
    <updated>2013-05-17T13:31:02Z</updated>
    <rights>Copyright (c) 2013, David Ortinau</rights>
    <generator uri="http://expressionengine.com/" version="1.6.6">ExpressionEngine</generator>
    <id>tag:davidortinau.com,2013:04:22</id>


    <entry>
      <title>Xamarin Evolve: Crafting Interactions with Core Animation</title>
      <link rel="alternate" type="text/html" href="http://www.davidortinau.com/site/xamarin_evolve_core_animation/" />
      <id>tag:davidortinau.com,2013:blog/index/1.84</id>
      <published>2013-04-22T17:04:01Z</published>
      <updated>2013-05-17T13:31:02Z</updated>
      <author>
            <name>David Ortinau</name>
            <email>dave@davidortinau.com</email>
                  </author>

      <category term="Xamarin"
        scheme="http://www.davidortinau.com/site/category/xamarin/"
        label="Xamarin" />
      <content type="html"><![CDATA[
        <p>The <a href="http://xamarin.com/evolve/2013" title="Xamarin Evolve 2013">Xamarin Evolve 2013</a> conference has come and gone, fueling me with inspiration. What an amazing conference! The Xamarin team and community are truly awesome. </p>

<p>At Evolve, I had to honor of presenting &#8220;Crafting Interactions with Core Animation&#8221;. Thanks to all that attended and indulged my enthusiasm for Interaction Design. Slides and code are below, and the session video will be available on the <a href="http://xamarin.com/evolve/2013" title="Evolve site">Evolve site</a>.</p>

<script async class="speakerdeck-embed" data-id="1aca83b08b5f01303fe222000a9d06df" data-ratio="1.72972972972973" src="//speakerdeck.com/assets/embed.js"></script>

<p><br />
Demos: <a href="https://github.com/davidortinau/monotouch-samples/tree/master/CoreAnimation" title="https://github.com/davidortinau/monotouch-samples/tree/master/CoreAnimation">https://github.com/davidortinau/monotouch-samples/tree/master/CoreAnimation</a></p> 
      ]]></content>
    </entry>

    <entry>
      <title>MonoTouch: How to Tell If The User Is Selecting Text or Tapping</title>
      <link rel="alternate" type="text/html" href="http://www.davidortinau.com/site/monotouch_how_to_tell_if_the_user_is_selecting_text_or_tapping/" />
      <id>tag:davidortinau.com,2012:blog/index/1.83</id>
      <published>2012-05-01T01:03:41Z</published>
      <updated>2013-05-17T13:30:42Z</updated>
      <author>
            <name>David Ortinau</name>
            <email>dave@davidortinau.com</email>
                  </author>

      <category term="iPhone"
        scheme="http://www.davidortinau.com/site/category/iphone/"
        label="iPhone" />
      <category term="MonoTouch"
        scheme="http://www.davidortinau.com/site/category/monotouch/"
        label="MonoTouch" />
      <category term="Xamarin"
        scheme="http://www.davidortinau.com/site/category/xamarin/"
        label="Xamarin" />
      <content type="html"><![CDATA[
        <h2>Goal</h2><p>
Show and hide a toolbar at the bottom of the view when the user taps.</p>

<h2>Why</h2><p>
Several apps, particularly those focus on reading the content in the view, offer a <a href="http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIToolbar_Class/Reference/Reference.html" title="UIToolbar">UIToolbar</a> (or a custom component with buttons) at the bottom of the view that shows or hides according to the user&#8217;s taps.</p>

<p>What we want to detect is a single tap. Not a swipe. Not drag. Not if the user is selecting text. </p>

<h2>How</h2><p>
Using a <a href="http://developer.apple.com/library/ios/#documentation/uikit/reference/UITapGestureRecognizer_Class/Reference/Reference.html" title="UITapGestureRecognizer">UITapGestureRecognizer</a> we can handle taps on the UIWebView. </p>

<p>I setup a delegate for it and assign a <a href="http://ios.xamarin.com/documentation/objective-c_selectors" title="Selector">Selector</a> to handle the event.</p>

<p>From there we need to determine if the user is selecting text or just tapping, and show/hide the toolbar.</p>

<h2>The Code</h2>

<script src="https://gist.github.com/2523148.js"> </script>

<p>&nbsp;</p> 
      ]]></content>
    </entry>

    <entry>
      <title>MonoTouch: Handle Events from UIWebView</title>
      <link rel="alternate" type="text/html" href="http://www.davidortinau.com/site/monotouch_handle_events_from_uiwebview/" />
      <id>tag:davidortinau.com,2012:blog/index/1.82</id>
      <published>2012-04-29T00:34:28Z</published>
      <updated>2013-05-17T13:30:29Z</updated>
      <author>
            <name>David Ortinau</name>
            <email>dave@davidortinau.com</email>
                  </author>

      <category term="iPhone"
        scheme="http://www.davidortinau.com/site/category/iphone/"
        label="iPhone" />
      <category term="MonoTouch"
        scheme="http://www.davidortinau.com/site/category/monotouch/"
        label="MonoTouch" />
      <category term="Xamarin"
        scheme="http://www.davidortinau.com/site/category/xamarin/"
        label="Xamarin" />
      <content type="html"><![CDATA[
        <h2>Goal</h2><p>
Handle taps on buttons and links within a <a href="http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebView_Class/Reference/Reference.html" title="UIWebView">UIWebView</a>.</p>

<h2>Why</h2><p>
I really like how <a href="http://www.readability.com" title="Readability">Readability</a>, <a href="http://pinterest.com/" title="Pinterest">Pinterest</a> and other apps hide or altogether don&#8217;t use a visible <a href="http://developer.apple.com/library/ios/#documentation/uikit/reference/UINavigationBar_Class/Reference/UINavigationBar.html" title="UINavigationBar">UINavigationBar</a> on appropriate views. </p>

<p><a href="http://www.davidortinau.com/images/uploads/readability_noNavBar.png"><img src="http://www.davidortinau.com/images/uploads/readability_noNavBar.png" style="border: 0;" alt="image" width="200" height="300" /></a> <a href="http://www.davidortinau.com/images/uploads/pinterest_noNavBar.png"><img src="http://www.davidortinau.com/images/uploads/pinterest_noNavBar_thumb.png" style="border: 0;" alt="image" width="200" height="300" /></a></p>

<p>Instead, the view is all about the content. I suspect many are using a UIWebView for the content. </p>

<p>The question then becomes, how does the user navigate the view stack from within a UIWebView.</p>

<p>Readability has a left to right swipe gesture that pulls he page away. I suspect this may be one UIViewController that shows a UIWebView over the top of the other content instead of pushing another view onto the stack. If you take a moment in Readability to pull the article away to partially reveal the list, you can scroll the list and see the article. I could be wrong&#8230;of anyone knows different do tell. I&#8217;m sure there&#8217;s more than one way to do this.</p>

<p><a href="http://www.davidortinau.com/images/uploads/readability_peel.png"><img src="http://www.davidortinau.com/images/uploads/readability_peel_thumb.png" style="border: 0;" alt="image" width="200" height="300" /></a></p>

<p>In the meantime, I want to add a back image link at the top of my HTML content, and handle that action from the view code.</p>

<p><img src="http://www.davidortinau.com/images/uploads/back_btn_webview.png" style="border: 0;" alt="image" width="229" height="78" /></p>

<h2>How</h2><p>
UIWebView provides <a href="http://docs.go-mono.com/index.aspx?link=P:MonoTouch.UIKit.UIWebView.ShouldStartLoad" title="ShouldStartLoad">ShouldStartLoad</a> where we can see what the component is about to load. At that point we can intercept the request and take a different action.</p>

<p>The Code: </p>

<p>
</p><script src="https://gist.github.com/2522938.js"> </script>

<p>In the HTML I have a link to the anchor #back like this:</p>

<p><pre class="csharp" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">&lt;</span>a href<span style="color: #008000;">=</span><span style="color: #666666;">&quot;#back&quot;</span><span style="color: #008000;">&gt;&lt;</span>img src<span style="color: #008000;">=</span><span style="color: #666666;">&quot;Images/btn_back.png&quot;</span> <span style="color: #008000;">/&gt;&lt;/</span>a<span style="color: #008000;">&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre></p>

<p>To load images into the UIWebView from the local resource bundle, I set the base URL of the request to NSBundle.MainBundle.BundleUrl.</p>

<p>When the user touches that link the webViewShouldStartLoad handles it and pops the view controller as desired. </p> 
      ]]></content>
    </entry>

    <entry>
      <title>Rage Against the Framework: Flash Camp St. Louis Slides and Code</title>
      <link rel="alternate" type="text/html" href="http://www.davidortinau.com/site/rage_against_the_framework_flash_camp_st._louis_slides_and_code/" />
      <id>tag:davidortinau.com,2011:blog/index/1.81</id>
      <published>2011-09-17T01:13:36Z</published>
      <updated>2011-09-17T01:30:37Z</updated>
      <author>
            <name>David Ortinau</name>
            <email>dave@davidortinau.com</email>
                  </author>

      <category term="General"
        scheme="http://www.davidortinau.com/site/category/general/"
        label="General" />
      <content type="html"><![CDATA[
        <p>We had a wonderful turnout at <a href="http://www.flashcampstlouis.com/" title="Flash Camp St. Louis">Flash Camp St. Louis</a>. Most impressive were all of the new faces. <a href="http://twitter.com/jprevel" title="JP Revel">JP Revel</a> did a fantastic job putting on the event.</p>

<p>In my session, &#8220;Rage Against the Framework&#8221;, I basically dumped all the tips and tricks and learning I&#8217;ve been doing over the past year of Flex 4 work. It&#8217;s been, at times, frustrating and slow. But there have also been moments of &#8220;Wow, I didn&#8217;t realize you could to THAT with Flex!&#8221;</p>

<p>We discussed the typical promises the Flex Framework makes to draw us in, such as data binding, components, and skins. While this gets us the majority of the way to where we want to be, we often encounter frustrating hurdles when trying to implement engaging user experiences. </p>

<p>Flex also provides States, State Transitions, and Layouts that, when properly understood and implemented, can help alleviate that frustration and do some really cool things.</p>

<div style="width:425px" id="__ss_9205511"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/davidortinau/rage-against-the-framework" title="Rage Against the Framework" target="_blank">Rage Against the Framework</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/9205511" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe> <div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/davidortinau" target="_blank">David Ortinau</a> </div> </div>

<h3>References</h3>

<p><b>Data Binding</b></p>

<p><a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf64c3d-7fff.html#WS2db454920e96a9e51e63e3d11c0bf69084-7cc8" onclick="window.open(this.href); return false;" >http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf64c3d-7fff.html#WS2db454920e96a9e51e63e3d11c0bf69084-7cc8</a></p>

<p><b>Binding Utils</b></p>

<p><a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/binding/utils/BindingUtils.html" onclick="window.open(this.href); return false;" >http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/binding/utils/BindingUtils.html</a></p>

<p><b>State Transitions</b></p>

<p><a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7fab.html" onclick="window.open(this.href); return false;" >http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7fab.html</a></p>

<p><a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/states/Transition.html" onclick="window.open(this.href); return false;" >http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/states/Transition.html</a></p>

<p><b>Effects</b></p>

<p><a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/effects/package-detail.html" onclick="window.open(this.href); return false;" >http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/effects/package-detail.html</a></p>

<p><b>Layouts</b></p>

<p><a href="http://tv.adobe.com/watch/max-2010-develop/having-fun-with-layouts-in-flex-4/" onclick="window.open(this.href); return false;" >http://tv.adobe.com/watch/max-2010-develop/having-fun-with-layouts-in-flex-4/</a></p>

<p><a href="http://www.rialvalue.com/blog/2010/11/04/slides-for-having-fun-with-layouts-in-flex-4/" onclick="window.open(this.href); return false;" >http://www.rialvalue.com/blog/2010/11/04/slides-for-having-fun-with-layouts-in-flex-4/</a></p>

<p><a href="http://evtimmy.com/2010/04/two-examples-of-layout-animations/" onclick="window.open(this.href); return false;" >http://evtimmy.com/2010/04/two-examples-of-layout-animations/</a></p>

<p><a href="http://tv.adobe.com/watch/flash-camp-boston/creating-custom-layouts-in-flex-4-" onclick="window.open(this.href); return false;" >http://tv.adobe.com/watch/flash-camp-boston/creating-custom-layouts-in-flex-4-</a></p>

<p><a href="http://miti.pricope.com/2009/05/29/playing-with-custom-layout-in-flex-4/" onclick="window.open(this.href); return false;" >http://miti.pricope.com/2009/05/29/playing-with-custom-layout-in-flex-4/</a></p>

<p><a href="http://www.tink.ws/blog/carousellayout/" onclick="window.open(this.href); return false;" >http://www.tink.ws/blog/carousellayout/</a></p>

<p>&nbsp;</p>

<p>Code Demo: <a href="http://davidortinau.com/exhibits/DataBindingTransitions/index.html" onclick="window.open(this.href); return false;" >http://davidortinau.com/exhibits/DataBindingTransitions/index.html</a></p>

<p>Source: <a href="http://www.davidortinau.com/images/uploads/DataBindingTransitions.zip">DataBindingTransitions.zip</a>
</p> 
      ]]></content>
    </entry>

    <entry>
      <title>Practical Interaction Design for Developers: Slides and Code</title>
      <link rel="alternate" type="text/html" href="http://www.davidortinau.com/site/practical_interaction_design_for_developers_slides_and_code/" />
      <id>tag:davidortinau.com,2011:blog/index/1.80</id>
      <published>2011-09-10T19:53:33Z</published>
      <updated>2011-09-10T20:12:34Z</updated>
      <author>
            <name>David Ortinau</name>
            <email>dave@davidortinau.com</email>
                  </author>

      <category term="Flex"
        scheme="http://www.davidortinau.com/site/category/flex/"
        label="Flex" />
      <category term="Interaction Design"
        scheme="http://www.davidortinau.com/site/category/interaction_design/"
        label="Interaction Design" />
      <content type="html"><![CDATA[
        <p>This summer we had a fantastic <a href="http://d2wc.com/" title="Designer/Developer Workflow Conference">Designer/Developer Workflow Conference</a> (D2WC) run by <a href="https://twitter.com/#!/DeeSadler" title="Dee Sadler">Dee Sadler</a>. I love the mix of visual creatives and code slingers all putting their minds together to learn from each other and discover better ways to work together towards amazing results. It&#8217;s great to dive deep into our own core disciplines, but we cannot neglect our teammates and understanding what it takes to work together. </p>

<p>Anyone who&#8217;s played an organized sport knows on some level that you need to know something about all of the positions in order to play your position well.</p>

<p>Here are the slides from my presentation, &#8220;Practical IxD for Developers&#8221;. It&#8217;s full of great quotes and references to books that I highly recommend. They are also listed on my <a href="http://davidortinau.com/bookshelf" title="bookshelf">bookshelf</a>.</p>

<div style="width:425px" id="__ss_9205526"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/davidortinau/practical-ixd-for-developers" title="Practical IxD for Developers" target="_blank">Practical IxD for Developers</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/9205526" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe> <div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/davidortinau" target="_blank">David Ortinau</a> </div> </div>

<p>And the code demo from the end of the presentation is below showing basic data binding and how to manage transitions via custom Layouts.</p>

<p>Code Demo: <a href="http://davidortinau.com/exhibits/DataBindingTransitions/index.html" onclick="window.open(this.href); return false;" >http://davidortinau.com/exhibits/DataBindingTransitions/index.html</a></p>

<p>Source: <a href="http://www.davidortinau.com/images/uploads/DataBindingTransitions.zip">DataBindingTransitions.zip</a>
</p> 
      ]]></content>
    </entry>

    <entry>
      <title>Upcoming Speaking Engagements</title>
      <link rel="alternate" type="text/html" href="http://www.davidortinau.com/site/upcoming_speaking_engagements/" />
      <id>tag:davidortinau.com,2011:blog/index/1.79</id>
      <published>2011-06-26T22:33:36Z</published>
      <updated>2011-06-27T15:17:37Z</updated>
      <author>
            <name>David Ortinau</name>
            <email>dave@davidortinau.com</email>
                  </author>

      <category term="General"
        scheme="http://www.davidortinau.com/site/category/general/"
        label="General" />
      <content type="html"><![CDATA[
        <p>This past May I had the opportunity to present at <a href="http://www.xplane.com/" title="XPLANE">XPLANE</a> on a topic I&#8217;m very passionate about, Interaction Design. This was a fun joint event with Gateway Chi, the St. Louis usability professionals group, and Flex and Fuse the Arch, my home Flex and Cold Fusion group.&nbsp; </p>

<p>July looks to be another busy month of speaking for me. If you happen to be near Kansas City or Chicago, and have any interest in Interaction Design and the designer/developer workflow, please come out and join us. As much as I enjoy presenting, I derive much greater pleasure from the ensuing discussions and exchange of knowledge.</p>

<p>July 14-16, 2011 <br />
D2W - Designer To Developer Workflow Conference<br />
Crowne Plaza<br />
Kansas City, MO<br />
<a href="http://d2wc.com/" onclick="window.open(this.href); return false;" >http://d2wc.com/</a><br />
<i>(I can give you a speaker discount, just contact me)</i></p>

<p>July 20, 2011<br />
Chicago Flex<br />
Chicago, IL<br />
<a href="http://chicagoflex.org/" onclick="window.open(this.href); return false;" >http://chicagoflex.org/</a></p>

<blockquote><p>“The big difference that’s arisen in this new agile world is how integrated the team is. No longer is UX design owned by the UX designers: everyone on the team now has design responsibilities. That means that everyone needs to be informed about what the design is trying to do.”<br />
- Jarod Spool</p></blockquote> 
      ]]></content>
    </entry>

    <entry>
      <title>Create a Twitter OAuth Application With Tweetr Using Single Access Token</title>
      <link rel="alternate" type="text/html" href="http://www.davidortinau.com/site/create_a_twitter_oauth_application_with_tweetr_using_single_access_token/" />
      <id>tag:davidortinau.com,2011:blog/index/1.78</id>
      <published>2011-01-20T21:25:01Z</published>
      <updated>2011-01-20T21:58:02Z</updated>
      <author>
            <name>David Ortinau</name>
            <email>dave@davidortinau.com</email>
                  </author>

      <category term="Flash"
        scheme="http://www.davidortinau.com/site/category/flash/"
        label="Flash" />
      <category term="Flex"
        scheme="http://www.davidortinau.com/site/category/flex/"
        label="Flex" />
      <category term="AIR"
        scheme="http://www.davidortinau.com/site/category/air/"
        label="AIR" />
      <content type="html"><![CDATA[
        <p>What do you do when you want to use the Twitter API with your own account, and don&#8217;t need or want users to login via the PIN OAuth dance? You can use a single access token/secret in place of the authenticated token/secret and get all the access you need. </p>

<blockquote><p>Note: the authenticated user in this scenario is you, the owner of the application.</p></blockquote>

<p>For this example I&#8217;m using <a href="http://wiki.swfjunkie.com/tweetr" title="Tweetr">Tweetr</a>, an AS3 library for accessing Twitter from your Flash or Flex application. Tweetr requires <a href="http://code.google.com/p/as3crypto/" title="as3crypto">as3crypto</a>. Details and downloads here: <a href="http://wiki.swfjunkie.com/tweetr:downloads" onclick="window.open(this.href); return false;" >http://wiki.swfjunkie.com/tweetr:downloads</a></p>

<p>Make sure you grab the proxy php and load that up on your server so you can have a service host. Run the install.php so it&#8217;s ready to go. This is a nice script providing caching so you get a little speed boost and don&#8217;t run over your Twitter API limit.</p>

<p>Ok, let&#8217;s get to it.</p>

<p>Create a <a href="http://dev.twitter.com/" title="Twitter Application">Twitter Application</a>, and make note of the Consumer key and secret on the settings page. Then on the right side of the profile click the button labeled &#8220;My Access Token&#8221;. Grab that Access Token and Access Token Secret. This is referred to as a &#8220;single access token&#8221;, &#8220;one access token&#8221;, or &#8220;single user access token&#8221;. Docs: <a href="http://dev.twitter.com/pages/oauth_single_token" onclick="window.open(this.href); return false;" >http://dev.twitter.com/pages/oauth_single_token</a></p>

<p>In your Flash application, implement Tweetr with OAuth. Import and other implementation details are omitted below.</p>

<p><pre class="actionscript" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> serviceHost : <span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;http://your_twittr_proxy_php_setup&quot;</span>;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> tweetr:Tweetr = <span style="color: #000000; font-weight: bold;">new</span> Tweetr<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">tweetr.<span style="color: #006600;">serviceHost</span> = serviceHost;           </div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">oauth = <span style="color: #000000; font-weight: bold;">new</span> OAuth<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">oauth.<span style="color: #006600;">serviceHost</span> = serviceHost;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">oauth.<span style="color: #006600;">consumerKey</span> = <span style="color: #ff0000;">&quot;CONSUMER_KEY&quot;</span>;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">oauth.<span style="color: #006600;">consumerSecret</span> = <span style="color: #ff0000;">&quot;CONSUMER_SECRET&quot;</span>;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">oauth.<span style="color: #006600;">oauthToken</span> = <span style="color: #ff0000;">&quot;MY_ACCESS_TOKEN&quot;</span>;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">oauth.<span style="color: #006600;">oauthTokenSecret</span> = <span style="color: #ff0000;">&quot;MY_ACCESS_TOKEN_SECRET&quot;</span>;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">tweetr.<span style="color: #006600;">oAuth</span> = oauth;    </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre> </p>

<p><br />
And then you need to&#8230;wait, sorry, that&#8217;s all there is. Start making calls to the API and listening for results.</p>

<p><pre class="actionscript" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">tweetr.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>TweetEvent.<span style="color: #006600;">COMPLETE</span>, handleLoad<span style="color: #66cc66;">&#41;</span>;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">tweetr.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>TweetEvent.<span style="color: #006600;">FAILED</span>, handleFail<span style="color: #66cc66;">&#41;</span>;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">tweetr.<span style="color: #006600;">getUserTimeLine</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre></p>

<p><pre class="actionscript" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> tweets:<span style="color: #0066CC;">Array</span> = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> handleLoad<span style="color: #66cc66;">&#40;</span>event:TweetEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&#123;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&lt;</span> event.<span style="color: #006600;">responseArray</span>.<span style="color: #0066CC;">length</span>; i++<span style="color: #66cc66;">&#41;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #66cc66;">&#123;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #000000; font-weight: bold;">var</span> statusData:StatusData = event.<span style="color: #006600;">responseArray</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            tweets.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>statusData<span style="color: #66cc66;">&#41;</span>;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #66cc66;">&#125;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #808080; font-style: italic;">// ... do something magical with the tweets</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&#125;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> handleFail<span style="color: #66cc66;">&#40;</span>event:TweetEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&#123;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">     <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Failed to get data&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">     <span style="color: #808080; font-style: italic;">// ... handle the disappointing failure...maybe a whale...just a thought</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&#125;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre></p>

<p>There are plenty of <a href="http://www.google.com/#sclient=psy&amp;hl=en&amp;q=tweetr+oauth+as3&amp;aq=f&amp;aqi=g-sx1g-o1&amp;aql=&amp;oq=&amp;pbx=1&amp;fp=25a0b2344dc0e416" title="good tutorials">good tutorials</a> out for using Tweetr, though beware of any too old. Twitter phased out basic authentication August 2010. </p>

<p>A couple I checked out:<br />
<a href="http://www.flashmobileblog.com/2010/06/18/air-on-android-tweetrapp-video-walk-through/" title="Mark Doherty: Tweetr App Video Walkthrough">Mark Doherty: Tweetr App Video Walkthrough</a><br />
<a href="http://blog.swfjunkie.com/2010/08/tweetr-tutorials-pinless-oauth-in-as3/" title="swfjunkie: PINless OAuth with Tweetr">swfjunkie: PINless OAuth with Tweetr</a></p>

<p>I also want to note that it&#8217;s difficult to secure anything in a Flash application, and the key, token, and secrets are no exception. In this example they are right there in the code, unencrypted. SWFs are easily decompiled. If you dream up a solid security solution that doesn&#8217;t require a mountain of effort, please let me know.
</p> 
      ]]></content>
    </entry>

    <entry>
      <title>Draw Lines Under Text in Spark RichEditableText</title>
      <link rel="alternate" type="text/html" href="http://www.davidortinau.com/site/draw_lines_under_text_in_spark_richeditabletext/" />
      <id>tag:davidortinau.com,2011:blog/index/1.77</id>
      <published>2011-01-15T19:26:36Z</published>
      <updated>2011-01-15T20:04:37Z</updated>
      <author>
            <name>David Ortinau</name>
            <email>dave@davidortinau.com</email>
                  </author>

      <category term="Flex"
        scheme="http://www.davidortinau.com/site/category/flex/"
        label="Flex" />
      <content type="html"><![CDATA[
        <p>On my current project, the design calls for displaying editable text with underlines that scroll with the text. It&#8217;s a nice design, and I had <b>no</b> good solution. I talked to a couple people, ideas were tossed around, and after a lot of reading and a couple runs at it I had nothing to show for the effort.</p>

<p>You can already see a working demo below. So how did I get there?</p>

<p>I had a nagging feeling I&#8217;d talked to someone about a workable solution, but I couldn&#8217;t remember who. <a href="http://guyinthechair.com/" title="Paul Taylor">Paul Taylor</a> (<a href="http://twitter.com/guyinthechair" title="@guyinthechair">@guyinthechair</a>) had shown me some of his excellent work with text during <a href="http://www.360flex.com/" title="360|Flex">360|Flex</a> in DC last year, and I figured if anyone was going to be able to help it&#8217;d be Paul. I put out a Twitter call for help, and, sure enough, he had an idea. And it&#8217;s so simple! </p>

<p>Paul extends <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/components/RichEditableText.html" title="RichEditableText">RichEditableText</a> and adds a handler for Event.ADDED which is triggered for each new line (or specifically for each time anything is added to the display list). Thanks Paul!</p>

<p><pre class="actionscript" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">package</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&#123;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">DisplayObject</span>;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Shape</span>;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">EventPhase</span>;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.<span style="color: #006600;">engine</span>.<span style="color: #006600;">TextLine</span>;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #0066CC;">import</span> spark.<span style="color: #006600;">components</span>.<span style="color: #006600;">RichEditableText</span>;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> LineyRET <span style="color: #0066CC;">extends</span> RichEditableText</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #66cc66;">&#123;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> LineyRET<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">		<span style="color: #66cc66;">&#123;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">			<span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">			addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ADDED</span>, onChildLineAdded<span style="color: #66cc66;">&#41;</span>;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">		<span style="color: #66cc66;">&#125;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onChildLineAdded<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">		<span style="color: #66cc66;">&#123;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">			<span style="color: #000000; font-weight: bold;">var</span> line:TextLine = event.<span style="color: #0066CC;">target</span> as TextLine;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span>line<span style="color: #66cc66;">&#41;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">				<span style="color: #b1b100;">return</span>;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>line.<span style="color: #006600;">getChildByName</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'baseline'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">				<span style="color: #b1b100;">return</span>;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">			<span style="color: #000000; font-weight: bold;">var</span> s:Shape = <span style="color: #000000; font-weight: bold;">new</span> Shape<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">			s.<span style="color: #0066CC;">name</span> = <span style="color: #ff0000;">'baseline'</span>;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">			s.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">lineStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>, 0xCCCCCC, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">			s.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">moveTo</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, line.<span style="color: #006600;">descent</span> + <span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">			s.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span>line.<span style="color: #006600;">specifiedWidth</span>, line.<span style="color: #006600;">descent</span> + <span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">			s.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">			line.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>s<span style="color: #66cc66;">&#41;</span>;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">		<span style="color: #66cc66;">&#125;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #66cc66;">&#125;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&#125;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre></p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="700" height="400" id="LineRichEditableTextDemo">
  <param name="movie" value="/exhibits/LineRichEditableTextDemo/LineRichEditableTextDemo.swf" />
  <param name="quality" value="high" />
  <param name="bgcolor" value="#ffffff" />
  <param name="allowScriptAccess" value="sameDomain" />
  <param name="allowFullScreen" value="true" />
&nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;   <!--[if !IE]>-->
  <object type="application/x-shockwave-flash" data="/exhibits/LineRichEditableTextDemo/LineRichEditableTextDemo.swf" width="700" height="400">
  <param name="quality" value="high" />
  <param name="bgcolor" value="#ffffff" />
  <param name="allowScriptAccess" value="sameDomain" />
  <param name="allowFullScreen" value="true" />
&nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;   <!--<![endif]-->
&nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;   <!--[if gte IE 6]>-->
  <p> 
&nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;   		Either scripts and active content are not permitted to run or Adobe Flash Player version
&nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;   		0.0.0 or greater is not installed.
&nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;   	</p><p>
&nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;   <!--<![endif]--><br />
&nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp; <a href="http://www.adobe.com/go/getflashplayer"><br />
&nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" /><br />
&nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp; </a><br />
&nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;   <!--[if !IE]>--><br />
&nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;   </p></object><p>
&nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;   <!--<![endif]--><br />
&nbsp;  &nbsp;  &nbsp;  &nbsp;  </p></object>

<p>&nbsp;</p>

<p>Melville text courtesy of <a href="http://www.fillerati.com/" title="Fillerati">Fillerati</a>.</p>

<p><a href="http://davidortinau.com/exhibits/LineRichEditableTextDemo/" title="Download demo source here">View and Download demo source here</a></p> 
      ]]></content>
    </entry>

    <entry>
      <title>Flex 4 States: The Default State?</title>
      <link rel="alternate" type="text/html" href="http://www.davidortinau.com/site/flex_4_states_the_default_state/" />
      <id>tag:davidortinau.com,2010:blog/index/1.76</id>
      <published>2010-12-16T16:26:44Z</published>
      <updated>2010-12-20T20:35:45Z</updated>
      <author>
            <name>David Ortinau</name>
            <email>dave@davidortinau.com</email>
                  </author>

      <category term="Flex"
        scheme="http://www.davidortinau.com/site/category/flex/"
        label="Flex" />
      <content type="html"><![CDATA[
        <p>You can call the first state in your list of states the default as Adobe&#8217;s Kevin Hoyt does in his <a href="http://blog.kevinhoyt.com/2010/06/flex-4-states-transitions-and-skins/" title="article about States">article about States</a>, and as Stephen Gilson does in his <a href="http://blogs.adobe.com/flexdoc/2010/03/new_view_state_syntax_for_flex.html" title="Flex Doc article">Flex Doc article</a>, but don&#8217;t expect it to always have your back. I found this out the usual way, I assumed and failed.</p>

<blockquote><p>The Actionscript 3.0 reference docs for <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/states/State.html?filter_coldfusion=9&amp;filter_flex=3&amp;filter_flashplayer=10&amp;filter_air=1.5" title="mx.states.State">mx.states.State</a> don&#8217;t clarify this issue, though it does make one reference to a &#8220;default view state&#8221;.</p></blockquote>

<p>Let&#8217;s say you have a component with 3 states:</p>

<p><pre class="actionscript" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:states<span style="color: #66cc66;">&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #66cc66;">&lt;</span>s:State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;welcome&quot;</span><span style="color: #66cc66;">/&gt;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #66cc66;">&lt;</span>s:State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;top_products&quot;</span><span style="color: #66cc66;">/&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	<span style="color: #66cc66;">&lt;</span>s:State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;all_products&quot;</span><span style="color: #66cc66;">/&gt;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;/</span>s:states<span style="color: #66cc66;">&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre></p>

<p><br />
And you have two ArrayCollections of Products, allProducts and topProducts, that will be bound to a DataGroup depending on the currentState of the view.</p>

<p><pre class="actionscript" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:DataGroup id=<span style="color: #ff0000;">&quot;productsDataGroup&quot;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	 dataProvider=<span style="color: #ff0000;">&quot;{allProducts}&quot;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	 dataProvider.<span style="color: #006600;">top_products</span>=<span style="color: #ff0000;">&quot;{topProducts}&quot;</span> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	... <span style="color: #66cc66;">/&gt;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre></p>

<p><br />
As you can see above I&#8217;ve declared the &#8220;main&#8221; dataProvider and a dataProvider for the state &#8220;top_products&#8221;. What data do you expect to get bound when I change currentState to &#8220;all_products&#8221; or even &#8220;welcome&#8221;? It will go back to allProducts. Great, that&#8217;s what I want. </p>

<p>BUT&#8230;</p>

<p>If the allProducts ArrayCollection has been changed in the meantime, the DataGroup will not rebind the allProducts collection, so I&#8217;ll be looking at old data. </p>

<p>The way to make sure the binding occurs as expected, and updates are reflected, is to get in the habit of being explicit.</p>

<p><pre class="actionscript" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:DataGroup id=<span style="color: #ff0000;">&quot;productsDataGroup&quot;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	 dataProvider=<span style="color: #ff0000;">&quot;{allProducts}&quot;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	 dataProvider.<span style="color: #006600;">welcome</span>=<span style="color: #ff0000;">&quot;{allProducts}&quot;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	 dataProvider.<span style="color: #006600;">top_products</span>=<span style="color: #ff0000;">&quot;{topProducts}&quot;</span> </div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	 dataProvider.<span style="color: #006600;">all_products</span>=<span style="color: #ff0000;">&quot;{allProducts}&quot;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	... <span style="color: #66cc66;">/&gt;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre></p>

<p><br />
Setting currentState in the component tag declaration is a good practice to make sure you start off in the right view. The consensus yesterday from conversations on Twitter is that the initial currentState will be the first state listed in the declaration. But this is not a default you can rely on once things start changing.</p>

<blockquote><p>When it comes to setting data providers, you are best off being explicit if you&#8217;re going to assign different sources based on state.</p></blockquote>

<p>Thanks to <a href="http://twitter.com/jamespolanco" title="@jamespolanco">@jamespolanco</a>, <a href="http://twitter.com/pollensoft" title="@pollensoft">@pollensoft</a>, <a href="http://twitter.com/derrickgrigg" title="@derrickgrigg">@derrickgrigg</a>, <a href="http://twitter.com/benjamminSTL" title="@benjamminSTL">@benjamminSTL</a>, and <a href="http://twitter.com/flexmonkeypatch" title="@flexmonkeypatch">@flexmonkeypatch</a> for your contributions to the discussion.</p> 
      ]]></content>
    </entry>

    <entry>
      <title>Spark States and Transitions: Working in Concert</title>
      <link rel="alternate" type="text/html" href="http://www.davidortinau.com/site/spark_states_and_transitions_working_in_concert/" />
      <id>tag:davidortinau.com,2010:blog/index/1.75</id>
      <published>2010-12-12T21:16:07Z</published>
      <updated>2010-12-12T22:30:09Z</updated>
      <author>
            <name>David Ortinau</name>
            <email>dave@davidortinau.com</email>
                  </author>

      <category term="Flex"
        scheme="http://www.davidortinau.com/site/category/flex/"
        label="Flex" />
      <content type="html"><![CDATA[
        <p>I commonly have in and out transitions for almost every view, sub view, and even component in my project. I often write my projects in pure AS3, so each class gets a transitionIn() and transitionOut() method dispatching completion events so I can synchronize transitions across views. All my mojo happens with TweenMax and clients love it.</p>

<p>I&#8217;ve been doing a lot more Spark skinning in Flex projects, so I was curious how I could accomplish the same using States, Transitions, and the newer Spark animation stuff. </p>

<p>All the examples I&#8217;ve found are flat&#8230;.the component manages it&#8217;s own states and directly transitions the children on its stage. Maybe I&#8217;m a dork, but my stuff isn&#8217;t so simple. When state changes in a component, it often needs to initiate in/out transitions on many children before just removing them from the stage. Dig?</p>

<blockquote><p><b>Note:</b> A component will receive addedToStage or removedFromStage events when its parent changes state and the component is included or excluded from that state.</p></blockquote><p> </p>

<h3>Scenario</h3><p>
Main view has 2 states, state1 and state2. When the button is clicked, it will toggle between states and change its label. There&#8217;s a logo on the screen that is included only in state2, has its own 2 states (hidden and visible), and includes transitions between each. </p>

<h3>Problem</h3><p>
If I let the main transition from state2 to state1 run by itself, it will remove the logo from the stage before logo has completed its own transition. I want the main transition to wait until the logo is done transitioning out before removing it from the stage.</p>

<h3>Solution</h3><p>
It&#8217;s actually quite simple to do this. The key is using s:Pause  in the main transition to listen for an event before proceeding&#8230;</p>

<p><br />
<pre class="actionscript" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:states<span style="color: #66cc66;">&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;state1&quot;</span> <span style="color: #66cc66;">/&gt;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;state2&quot;</span> <span style="color: #66cc66;">/&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;/</span>s:states<span style="color: #66cc66;">&gt;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:transitions<span style="color: #66cc66;">&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:Transition fromState=<span style="color: #ff0000;">&quot;state2&quot;</span> toState=<span style="color: #ff0000;">&quot;*&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:Sequence<span style="color: #66cc66;">&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:SetAction <span style="color: #0066CC;">target</span>=<span style="color: #ff0000;">&quot;{logo}&quot;</span> property=<span style="color: #ff0000;">&quot;currentState&quot;</span> value=<span style="color: #ff0000;">&quot;hidden&quot;</span><span style="color: #66cc66;">/&gt;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:<span style="color: #0066CC;">Pause</span> <span style="color: #0066CC;">target</span>=<span style="color: #ff0000;">&quot;{logo}&quot;</span> eventName=<span style="color: #ff0000;">&quot;{Logo.TRANSITIONED_OUT}&quot;</span> <span style="color: #66cc66;">/&gt;</span> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:RemoveAction <span style="color: #0066CC;">target</span>=<span style="color: #ff0000;">&quot;{logo}&quot;</span> <span style="color: #66cc66;">/&gt;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;/</span>s:Sequence<span style="color: #66cc66;">&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;/</span>s:Transition<span style="color: #66cc66;">&gt;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;/</span>s:transitions<span style="color: #66cc66;">&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre></p>

<p><br />
... and then when the logo is done transitioning out, use s:CallAction to dispatch the completion event thus unpausing and completing the other transition which will finish with s:RemoveAction.</p>

<p><br />
<pre class="actionscript" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:Transition fromState=<span style="color: #ff0000;">&quot;visible&quot;</span> toState=<span style="color: #ff0000;">&quot;*&quot;</span> autoReverse=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:Sequence<span style="color: #66cc66;">&gt;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:Parallel id=<span style="color: #ff0000;">&quot;outTransition&quot;</span> <span style="color: #0066CC;">duration</span>=<span style="color: #ff0000;">&quot;500&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:Fade <span style="color: #0066CC;">target</span>=<span style="color: #ff0000;">&quot;{simplyProfoundLogo}&quot;</span> alphaFrom=<span style="color: #ff0000;">&quot;1&quot;</span> alphaTo=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #66cc66;">/&gt;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:Move <span style="color: #0066CC;">target</span>=<span style="color: #ff0000;">&quot;{simplyProfoundLogo}&quot;</span> xTo=<span style="color: #ff0000;">&quot;600&quot;</span> <span style="color: #66cc66;">/&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;/</span>s:Parallel<span style="color: #66cc66;">&gt;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:CallAction <span style="color: #0066CC;">target</span>=<span style="color: #ff0000;">&quot;{this}&quot;</span> functionName=<span style="color: #ff0000;">&quot;dispatchEvent&quot;</span> args=<span style="color: #ff0000;">&quot;{[new Event(TRANSITIONED_OUT)]}&quot;</span> <span style="color: #66cc66;">/&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;/</span>s:Sequence<span style="color: #66cc66;">&gt;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;/</span>s:Transition<span style="color: #66cc66;">&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre></p>

<p><br />
Download Source: <a href="http://cl.ly/3bDx" title="SparkStateTransitions.fxp">SparkStateTransitions.fxp</a></p>

<p>Big thanks to <a href="http://twitter.com/#!/_leonardsouza_" title="Leonard Souza">@_leonardsouza_</a>, <a href="http://twitter.com/s9tpepper" title="@s9tpepper">@s9tpepper</a>, <a href="http://twitter.com/john__olson" title="@john__olson">@john__olson</a>, <a href="http://twitter.com/polygeek" title="@polygeek">@polygeek</a>, <a href="http://twitter.com/jesterxl" title="@jesterxl">@jesterxl</a>, and <a href="http://twitter.com/terencecarroll" title="@terencecarroll">@terencecarroll</a> for helping me out.</p>

<blockquote><p>On the flipside, what the heck is wrong with the Flex 4 reference documentation regarding states, transitions and effects? What a mess. Maybe it&#8217;s just me, but I find it pretty unhelpful and even downright confusing at times.</p></blockquote>

<h3>Examples and Resources</h3><p>
<a href="http://twitter.com/#!/_leonardsouza_" title="Leonard Souza">Leonard Souza</a>: <a href="http://www.leonardsouza.com/flex/flexerific/" title="Flexerific Visual Effects">Flexerific Visual Effects</a> (highly recommend his <a href="http://www.360flex.com/session-videos/" title="video from 360|Flex DC">video from 360|Flex DC</a>)</p>

<p>Chet Haase on Spark Effects. SVFUG recording: <a href="http://goo.gl/7EWhA" onclick="window.open(this.href); return false;" >http://goo.gl/7EWhA</a></p>

<p>Chet Haase Flex 4 Fun book: <a href="http://goo.gl/ooC5W" onclick="window.open(this.href); return false;" >http://goo.gl/ooC5W</a> Discount code: FUG1</p>

<p>Jacob Surber on Flex Skins/FXG. SVFUG recording: <a href="http://goo.gl/nFdst" onclick="window.open(this.href); return false;" >http://goo.gl/nFdst</a></p>

<p>Custom Components in Flex 4 presentation by <a href="http://twitter.com/mrinal" title="@mrinal">@mrinal</a>: <a href="http://weblog.mrinalwadhwa.com/2009/12/01/custom-components-in-flex-4/" onclick="window.open(this.href); return false;" >http://weblog.mrinalwadhwa.com/2009/12/01/custom-components-in-flex-4/</a></p>

<p><a href="http://twitter.com/polygeek" title="Dan Florio">Dan Florio</a>&#8216;s posts on Flex 4 State transitions: <a href="http://polygeek.com/2304_flex_simple-flex-4-component-checkedunchecked" onclick="window.open(this.href); return false;" >http://polygeek.com/2304_flex_simple-flex-4-component-checkedunchecked</a> and <a href="http://polygeek.com/2506_flex_using-wildcards-in-flex-4-state-transitions" onclick="window.open(this.href); return false;" >http://polygeek.com/2506_flex_using-wildcards-in-flex-4-state-transitions</a>
</p> 
      ]]></content>
    </entry>

    <entry>
      <title>Flex Hero Gotcha: Application Freeze on navigator.popView and navigator.popToFirstView</title>
      <link rel="alternate" type="text/html" href="http://www.davidortinau.com/site/flex_hero_gotcha_application_freeze/" />
      <id>tag:davidortinau.com,2010:blog/index/1.74</id>
      <published>2010-10-28T15:02:14Z</published>
      <updated>2010-10-28T18:40:15Z</updated>
      <author>
            <name>David Ortinau</name>
            <email>dave@davidortinau.com</email>
                  </author>

      <category term="Flex"
        scheme="http://www.davidortinau.com/site/category/flex/"
        label="Flex" />
      <category term="AIR"
        scheme="http://www.davidortinau.com/site/category/air/"
        label="AIR" />
      <content type="html"><![CDATA[
        <p>I&#8217;ve been spending a lot of time in <a href="http://labs.adobe.com/technologies/flexsdk_hero/" title="Flex &quot;Hero&quot; preview release">Flex &#8220;Hero&#8221; preview release</a> since it was released Sunday evening. Overall it&#8217;s quite good, I&#8217;m very happy to have it, and I&#8217;ve been able to do what I need to with my pretty basic app. </p>

<p>I ran into a pretty disconcerting gotcha and I wanted to post it here in case anyone else happens upon this.</p>

<h2>Symptom</h2><p>
You navigate back to a previous view via navigator.popView() or navigator.popToFirstView() and the application stalls without an error</p>

<h2>How to Reproduce It</h2><p>
If you are using the <a href="http://labs.adobe.com/technologies/flexsdk_hero/samples/" title="Employee Directory from the sample apps">Employee Directory from the sample apps</a> as your jumping off point, the EmployeeDirectoryHome.mxml has a search box and button in the navigation area. That&#8217;s fine and the app runs. </p>

<p><pre class="actionscript" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:actionContent<span style="color: #66cc66;">&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">          <span style="color: #66cc66;">&lt;</span>s:TextInput id=<span style="color: #ff0000;">&quot;searchKey&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;{width - searchBtn.width - 16}&quot;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                          <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;{SEARCH_TEXT}&quot;</span> focusIn=<span style="color: #ff0000;">&quot;searchKey.text=''&quot;</span> <span style="color: #0066CC;">enter</span>=<span style="color: #ff0000;">&quot;search()&quot;</span><span style="color: #66cc66;">/&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">          <span style="color: #66cc66;">&lt;</span>s:<span style="color: #0066CC;">Button</span> id=<span style="color: #ff0000;">&quot;searchBtn&quot;</span> icon=<span style="color: #ff0000;">&quot;@Embed('assets/search.png')&quot;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                      click=<span style="color: #ff0000;">&quot;search()&quot;</span><span style="color: #66cc66;">/&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">     <span style="color: #66cc66;">&lt;/</span>s:actionContent<span style="color: #66cc66;">&gt;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre></p>

<p>Move the search box and button into an HGroup and positioned it below the navigation. Suddenly any call to navigator.popView() will go into la la land and the entire app will freeze. No error is thrown. Eventually, if you&#8217;re running on a device, you&#8217;ll be prompted to kill the app or wait. Don&#8217;t bother waiting.</p>

<p><pre class="actionscript" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:HGroup paddingLeft=<span style="color: #ff0000;">&quot;8&quot;</span> paddingTop=<span style="color: #ff0000;">&quot;0&quot;</span> gap=<span style="color: #ff0000;">&quot;8&quot;</span> verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;80&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&gt;</span> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #66cc66;">&lt;</span>s:TextInput id=<span style="color: #ff0000;">&quot;searchKey&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;{width - searchBtn.width - 16}&quot;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                          <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;{SEARCH_TEXT}&quot;</span> focusIn=<span style="color: #ff0000;">&quot;searchKey.text=''&quot;</span> <span style="color: #0066CC;">enter</span>=<span style="color: #ff0000;">&quot;search()&quot;</span><span style="color: #66cc66;">/&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">          <span style="color: #66cc66;">&lt;</span>s:<span style="color: #0066CC;">Button</span> id=<span style="color: #ff0000;">&quot;searchBtn&quot;</span> icon=<span style="color: #ff0000;">&quot;@Embed('assets/search.png')&quot;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                      click=<span style="color: #ff0000;">&quot;search()&quot;</span><span style="color: #66cc66;">/&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;/</span>s:HGroup<span style="color: #66cc66;">&gt;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre></p>

<p>
</p><h2>Workaround</h2><p>
With the keen eye and assistance of <a href="http://twitter.com/jayfour000" title="Jason Hanson">Jason Hanson</a>, we determined that the measuring and drawing of content in the actionContent and navigationContent must happen at a different stage than the rest of the visual children. The width of the TextInput was being calculated instead being set as a percentage, and it was removing that calculation that fixed the issue. So, changing the width to 100% causes the TextInput to &#8220;greedily&#8221;, as Jason would say, take up all available space left by the button and the app once again works just fine.</p>

<p><pre class="actionscript" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:HGroup paddingLeft=<span style="color: #ff0000;">&quot;8&quot;</span> paddingTop=<span style="color: #ff0000;">&quot;0&quot;</span> gap=<span style="color: #ff0000;">&quot;8&quot;</span> verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;80&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&gt;</span> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:TextInput id=<span style="color: #ff0000;">&quot;searchKey&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;{SEARCH_TEXT}&quot;</span> focusIn=<span style="color: #ff0000;">&quot;searchKey.text=''&quot;</span> <span style="color: #0066CC;">enter</span>=<span style="color: #ff0000;">&quot;search()&quot;</span> <span style="color: #66cc66;">/&gt;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;</span>s:<span style="color: #0066CC;">Button</span> id=<span style="color: #ff0000;">&quot;searchBtn&quot;</span> icon=<span style="color: #ff0000;">&quot;@Embed('assets/search.png')&quot;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">              click=<span style="color: #ff0000;">&quot;search()&quot;</span><span style="color: #66cc66;">/&gt;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&lt;/</span>s:HGroup<span style="color: #66cc66;">&gt;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre></p>

<p>I&#8217;ve logged a JIRA bug for this issue.</p>

<p>Hero is definitely prerelease and this is one example of where that shows up. </p>

<p>I highly recommend you check out the <a href="http://labs.adobe.com/technologies/flexsdk_hero/samples/" title="Shopping Cart Application for Web and Mobile">Shopping Cart Application for Web and Mobile</a> to see more advanced solutions. Thanks Jason!</p>

<p><br />
<img src="http://www.davidortinau.com/images/uploads/screenshot_30.png" style="border: 0;" alt="image" width="480" height="800" /></p> 
      ]]></content>
    </entry>

    <entry>
      <title>360|Flex Slides and Links &#45; How to Scale Your Freelance Business and Maximize Profit</title>
      <link rel="alternate" type="text/html" href="http://www.davidortinau.com/site/360flex_slides_and_links_-_how_to_scale_your_freelance_business_and_maximiz/" />
      <id>tag:davidortinau.com,2010:blog/index/1.73</id>
      <published>2010-09-24T17:24:49Z</published>
      <updated>2010-09-25T03:08:50Z</updated>
      <author>
            <name>David Ortinau</name>
            <email>dave@davidortinau.com</email>
                  </author>

      <category term="General"
        scheme="http://www.davidortinau.com/site/category/general/"
        label="General" />
      <category term="Freelancing"
        scheme="http://www.davidortinau.com/site/category/freelancing/"
        label="Freelancing" />
      <content type="html"><![CDATA[
        <p>In this session we talked about subcontracting, interviewing, qualifying opportunities, relationships and much more&#8230;all leading to a stronger, more profitable business. </p>

<p>One point I didn&#8217;t touch on, but which I think is very cool is that scaling goes both up and down. When business slows, we can scale back down to a solo operation without killing our business. And then as things heat up, we can scale to meet those challenges.</p>

<p>Below are the slides from the presentation and additional links to resources I&#8217;ve found extremely useful over the years.</p>

<div style="width:425px" id="__ss_5277987"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/davidortinau/how-to-scale-your-freelance-business-and-maximize-profit" title="How To Scale Your Freelance Business and Maximize Profit">How To Scale Your Freelance Business and Maximize Profit</a></strong><object id="__sse5277987" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=360flexscaleandgrowfreelancebusiness-100924104908-phpapp01&amp;stripped_title=how-to-scale-your-freelance-business-and-maximize-profit&amp;userName=davidortinau" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse5277987" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=360flexscaleandgrowfreelancebusiness-100924104908-phpapp01&amp;stripped_title=how-to-scale-your-freelance-business-and-maximize-profit&amp;userName=davidortinau" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/davidortinau">David Ortinau</a>.</div></div>

<h2>Additional Links</h2><p>
<a href="http://5by5.tv/pipeline" title="The Pipeline">The Pipeline</a> - a podcast from Dan Benjamin<br />
<a href="http://insideria.com/riaradio.html" title="RIA Radio">RIA Radio</a> - a podcast from Garth Braithwaite and others<br />
<a href="http://www.amazon.com/E-Myth-Revisited-Small-Businesses-About/dp/0887307280/ref=sr_1_1?s=gateway&amp;ie=UTF8&amp;qid=1285348177&amp;sr=8-1" title="The E-Myth Revisited">The E-Myth Revisited</a><br />
<a href="http://www.amazon.com/Getting-Things-Done-Stress-Free-Productivity/dp/0142000280/ref=sr_1_1?s=gateway&amp;ie=UTF8&amp;qid=1285348479&amp;sr=8-1" title="Getting Things Done: The Art of Stress-Free Productivity">Getting Things Done: The Art of Stress-Free Productivity</a><br />
<a href="http://www.amazon.com/Rework-Jason-Fried/dp/0307463745/ref=sr_1_1?s=gateway&amp;ie=UTF8&amp;qid=1285348535&amp;sr=8-1" title="Rework">Rework</a><br />
<a href="http://www.amazon.com/Making-Ideas-Happen-Overcoming-Obstacles/dp/159184312X/ref=sr_1_1?s=gateway&amp;ie=UTF8&amp;qid=1285348836&amp;sr=8-1" title="Making Ideas Happen">Making Ideas Happen</a><br />
<a href="http://www.amazon.com/Art-War-Sun-Tzu/dp/1453751793/ref=sr_1_1?s=gateway&amp;ie=UTF8&amp;qid=1285348868&amp;sr=8-1" title="The Art of War">The Art of War</a><br />
<a href="http://www.amazon.com/One-Minute-Manager-Kenneth-Blanchard/dp/0688014291/ref=sr_1_1?s=gateway&amp;ie=UTF8&amp;qid=1285348898&amp;sr=8-1" title="The One Minute Manager">The One Minute Manager</a><br />
<a href="http://www.amazon.com/Pricing-Purpose-Creating-Capturing-Value/dp/0471729809/ref=sr_1_1?s=gateway&amp;ie=UTF8&amp;qid=1285348957&amp;sr=8-1" title="Pricing on Purpose: Creating and Capturing Value">Pricing on Purpose: Creating and Capturing Value</a><br />
<a href="http://www.amazon.com/First-Break-All-Rules-Differently/dp/0684852861/ref=sr_1_1?s=gateway&amp;ie=UTF8&amp;qid=1285384022&amp;sr=8-1" title="First Break All The Rules: What the World's Greatest Managers Do Differently">First Break All The Rules: What the World&#8217;s Greatest Managers Do Differently</a><br />
<a href="http://www.amazon.com/21-Irrefutable-Laws-Leadership-Follow/dp/0785288376/ref=sr_1_1?s=gateway&amp;ie=UTF8&amp;qid=1285384087&amp;sr=8-1" title="The 21 Irrefutable Laws of Leadership">The 21 Irrefutable Laws of Leadership</a></p> 
      ]]></content>
    </entry>

    <entry>
      <title>360|Flex Slides and Links &#45; The Invaluable Freelance Flasher</title>
      <link rel="alternate" type="text/html" href="http://www.davidortinau.com/site/360flex_slides_and_links_-_the_invaluable_freelance_flasher/" />
      <id>tag:davidortinau.com,2010:blog/index/1.72</id>
      <published>2010-09-24T15:51:27Z</published>
      <updated>2010-09-24T17:31:28Z</updated>
      <author>
            <name>David Ortinau</name>
            <email>dave@davidortinau.com</email>
                  </author>

      <category term="General"
        scheme="http://www.davidortinau.com/site/category/general/"
        label="General" />
      <category term="Freelancing"
        scheme="http://www.davidortinau.com/site/category/freelancing/"
        label="Freelancing" />
      <content type="html"><![CDATA[
        <p>A big thanks to John and Nicole Wilker for another great 360Flex conference! And to everyone that braved my sessions, we had a lot of fun and hopefully took away something useful and encouraging.</p>

<p>The sessions were recorded. When those are made available I&#8217;ll post links.</p>

<p>Here are the slides from this session and additional links to resources I referenced.</p>

<div style="width:425px" id="__ss_5277861"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/davidortinau/the-invaluable-freelance-flasher" title="The Invaluable Freelance Flasher">The Invaluable Freelance Flasher</a></strong><object id="__sse5277861" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=360flextheinvaluablefreelanceflasher-100924103138-phpapp01&amp;stripped_title=the-invaluable-freelance-flasher&amp;userName=davidortinau" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse5277861" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=360flextheinvaluablefreelanceflasher-100924103138-phpapp01&amp;stripped_title=the-invaluable-freelance-flasher&amp;userName=davidortinau" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/davidortinau">David Ortinau</a>.</div></div>

<h2>Additional Links</h2><p>
<a href="http://5by5.tv/pipeline" title="The Pipeline">The Pipeline</a> - a podcast from Dan Benjamin<br />
<a href="http://insideria.com/riaradio.html" title="RIA Radio">RIA Radio</a> - a podcast from Garth Braithwaite and others<br />
<a href="http://www.amazon.com/E-Myth-Revisited-Small-Businesses-About/dp/0887307280/ref=sr_1_1?s=gateway&amp;ie=UTF8&amp;qid=1285348177&amp;sr=8-1" title="The E-Myth Revisited">The E-Myth Revisited</a><br />
<a href="http://www.amazon.com/Getting-Things-Done-Stress-Free-Productivity/dp/0142000280/ref=sr_1_1?s=gateway&amp;ie=UTF8&amp;qid=1285348479&amp;sr=8-1" title="Getting Things Done: The Art of Stress-Free Productivity">Getting Things Done: The Art of Stress-Free Productivity</a><br />
<a href="http://www.amazon.com/Rework-Jason-Fried/dp/0307463745/ref=sr_1_1?s=gateway&amp;ie=UTF8&amp;qid=1285348535&amp;sr=8-1" title="Rework">Rework</a><br />
<a href="http://www.amazon.com/Making-Ideas-Happen-Overcoming-Obstacles/dp/159184312X/ref=sr_1_1?s=gateway&amp;ie=UTF8&amp;qid=1285348836&amp;sr=8-1" title="Making Ideas Happen">Making Ideas Happen</a><br />
<a href="http://www.amazon.com/Art-War-Sun-Tzu/dp/1453751793/ref=sr_1_1?s=gateway&amp;ie=UTF8&amp;qid=1285348868&amp;sr=8-1" title="The Art of War">The Art of War</a><br />
<a href="http://www.amazon.com/One-Minute-Manager-Kenneth-Blanchard/dp/0688014291/ref=sr_1_1?s=gateway&amp;ie=UTF8&amp;qid=1285348898&amp;sr=8-1" title="The One Minute Manager">The One Minute Manager</a><br />
<a href="http://www.amazon.com/Pricing-Purpose-Creating-Capturing-Value/dp/0471729809/ref=sr_1_1?s=gateway&amp;ie=UTF8&amp;qid=1285348957&amp;sr=8-1" title="Pricing on Purpose: Creating and Capturing Value">Pricing on Purpose: Creating and Capturing Value</a></p> 
      ]]></content>
    </entry>

    <entry>
      <title>360|Flex DC and a Free FDT Pure License</title>
      <link rel="alternate" type="text/html" href="http://www.davidortinau.com/site/360flex_dc_and_a_free_fdt_pure_license/" />
      <id>tag:davidortinau.com,2010:blog/index/1.71</id>
      <published>2010-09-15T05:35:58Z</published>
      <updated>2010-09-24T17:31:59Z</updated>
      <author>
            <name>David Ortinau</name>
            <email>dave@davidortinau.com</email>
                  </author>

      <category term="General"
        scheme="http://www.davidortinau.com/site/category/general/"
        label="General" />
      <content type="html"><![CDATA[
        <p><a href="http://www.360flex.com/" title="360Flex">360Flex</a> is not just fast approaching, it is upon us! John Wilker has been posting speaker interviews leading up to next week&#8217;s conference and has evidently been saving the best for (near) last. <a href="http://www.360flex.com/blog/2010/09/360flex-speaker-david-ortinau/" title="Check out my interview">Check out my interview here</a> (yes, we removed the tips from the arrows&#8230;eventually).</p>

<p>In FDT&#8217;s apparent mission to <a href="http://en.wikipedia.org/wiki/Pinky_and_the_Brain" title="take over the world">take over the world</a>, they have given me a FREE<a href="http://www.fdt.powerflasher.com/" title=" FDT Pure"> FDT Pure</a> License to give away during my session &#8220;The Invaluable Freelance Flasher&#8221;. I&#8217;ll figure some random way to select the winner. Hint: sit near the front and participate.</p>

<p>Freelance business for Flash development is booming. I&#8217;m extremely excited to speak on this topic and share experiences and ideas with many of the brightest Flash platform developers around. So, when you need a break from nerding out at the code sessions (I&#8217;ll be there too), come check out my sessions. </p>

<p>You&#8217;ll be glad you did. </p>

<p>I&#8217;ve seen the slides.</p> 
      ]]></content>
    </entry>

    <entry>
      <title>Slides and Demos from Flash Camp St. Louis 2010</title>
      <link rel="alternate" type="text/html" href="http://www.davidortinau.com/site/slides_and_demos_from_flash_camp_st._louis_2010/" />
      <id>tag:davidortinau.com,2010:blog/index/1.70</id>
      <published>2010-09-04T15:20:27Z</published>
      <updated>2011-05-04T20:21:28Z</updated>
      <author>
            <name>David Ortinau</name>
            <email>dave@davidortinau.com</email>
                  </author>

      <category term="Flash"
        scheme="http://www.davidortinau.com/site/category/flash/"
        label="Flash" />
      <category term="General"
        scheme="http://www.davidortinau.com/site/category/general/"
        label="General" />
      <category term="Flex"
        scheme="http://www.davidortinau.com/site/category/flex/"
        label="Flex" />
      <content type="html"><![CDATA[
        <p>What a great day! I loved seeing the awesome turnout of Flash designers and developers from around the area, including many interactive compatriots I hadn&#8217;t seen in quite a while. You guys are awesome!</p>

<p>Here are my <a href="http://www.slideshare.net/davidortinau/managing-and-using-assets-in-rich-flash-experiences" title="slides">slides</a> and <a href="http://davidortinau.com/exhibits/FlashCampSTLDemos.zip" title="an archive of the demos">an archive of the demos</a> I showed during my session. </p>

<p>The demos are FDT projects, so head over to <a href="http://www.fdt.powerflasher.com/" title="Powerflasher">Powerflasher</a> and get your demo copy of FDT4. And if you don&#8217;t have a license, be sure to follow <a href="http://twitter.com/brunofonzi" title="@brunofonzi">@brunofonzi</a>, <a href="http://twitter.com/brittrking" title="@brittrking">@brittrking</a>, <a href="http://twitter.com/davidortinau" title="myself">myself</a>, and <a href="http://twitter.com/#search?q=%23FDT" title="many others">many others</a> that seem to weekly be tweeting or retweeting ways to get a free Pure license.</p>

<p>To use the demos, open a new workspace in FDT, choose to Import > General > Existing Projects into Workspace. Browse to the extracted the ZIP file and choose each project individually. It should end up looking like this:</p>

<p><img src="http://www.davidortinau.com/images/uploads/demo_projects.png" style="border: 0;" alt="image" width="243" height="434" /></p>

<p>In the demos you&#8217;ll find 3 projects:</p>

<p>1) AssetsExamples</p>

<p>This is the demo I also performed step by step in the <a href="http://vimeo.com/14148808" title="screencast on Vimeo">screencast on Vimeo</a>. I demonstrate how to create assets in Flash Pro, produce a SWC file, make that SWC available in an FDT (or Flash Builder) project and then a variety of ways you can use and add behavior to those assets.</p>

<p>2) LoaderMaxExample</p>

<p>This code demonstrates the flexibility of bulk loading a variety of different asset types by defining them in an XML manifest document with custom properties telling LoaderMax how to handle them.</p>

<blockquote><p>NOTE: for this example and the next you will need to set your Flash Player security to so you don&#8217;t get a SandBox violation. Open the FDTLaunch.cfg file you&#8217;ll find here: ~/Library/Preferences/Macromedia/Flash Player/#Security/FlashPlayerTrust/ and add paths to your project locations. Then restart FDT. Here are mine:</p>

<p>file:////Users/dave/work/SimplyProfound/LoaderMaxExample/bin/<br />
file:////Users/dave/work/SimplyProfound/SWFLoaderExample/bin/</p></blockquote>

<p>During my talk I also showed code from the <a href="http://stltweets.com/" title="STLTweets">STLTweets</a> LouFest twitter display that I did with the guys at <a href="http://www.infuz.com/" title="Infuz">Infuz</a>. I can&#8217;t share the entire app, but the relevant code below demonstrates how you can load images directly into containers, define the desired size, and then the scaling parameters to make sure your image fits and fills that space when it&#8217;s loaded. Awesome mojo from <a href="http://www.greensock.com/loadermax/" title="Greensock">Greensock</a>!</p>

<p><actionscript></p><p>
photoLoader = new ImageLoader(vo.linkThumbnail, {smoothing:true, container:tweet.imgPhoto, width:400, height:300, scaleMode:"proportionalInside"});<br />
photoLoader.load();<br />
					<br />
iconLoader = new ImageLoader(vo.profileImageURL, {smoothing:true, container:tweet.imgUserIcon, width:60, height:60, scaleMode:"proportionalOutside"});<br />
iconLoader.load();
</p><p></actionscript></p>

<p>3) SWFLoaderExample</p>

<p>This set of examples demonstrates using a utilities like <a href="http://casalib.org/" title="CASA Lib">CASA Lib</a> to load linked assets from swf files. This method is more akin to the old school AS2 way of doing things and lacks the strong typing I prefer (and why I use SWCs more often). It&#8217;s a very cool and useful way of loading multiple swfs and accessing the libraries.</p>

<div style="width:425px" id="__ss_5128855"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/davidortinau/managing-and-using-assets-in-rich-flash-experiences" title="Managing and Using Assets in Rich Flash Experiences">Managing and Using Assets in Rich Flash Experiences</a></strong><object id="__sse5128855" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=flashcamp2010-100904092422-phpapp01&amp;stripped_title=managing-and-using-assets-in-rich-flash-experiences" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse5128855" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=flashcamp2010-100904092422-phpapp01&amp;stripped_title=managing-and-using-assets-in-rich-flash-experiences" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/davidortinau">David Ortinau</a>.</div></div>

<p><a href="davidortinau.com/exhibits/FlashCampSTLDemos.zip" title="Download Demo Code Projects">Download Demo Code Projects</a></p> 
      ]]></content>
    </entry>


</feed>