<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">

    <channel>
    
    <title>David Ortinau</title>
    <link>http://www.davidortinau.com/blog/index/</link>
    <description></description>
    <dc:language>en</dc:language>
    <dc:creator>dave@davidortinau.com</dc:creator>
    <dc:rights>Copyright 2012</dc:rights>
    <dc:date>2012-05-01T01:03:06+00:00</dc:date>
    <admin:generatorAgent rdf:resource="http://expressionengine.com/" />
    

    <item>
      <title>MonoTouch: How to Tell If The User Is Selecting Text or Tapping</title>
      <link>http://www.davidortinau.com/site/monotouch_how_to_tell_if_the_user_is_selecting_text_or_tapping/</link>
      <guid>http://www.davidortinau.com/site/monotouch_how_to_tell_if_the_user_is_selecting_text_or_tapping/#When:01:03:06Z</guid>
      <description>Goal
Show and hide a toolbar at the bottom of the view when the user taps.

Why
Several apps, particularly those focus on reading the content in the view, offer a UIToolbar (or a custom component with buttons) at the bottom of the view that shows or hides according to the user&#8217;s taps.

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

How
Using a UITapGestureRecognizer we can handle taps on the UIWebView. 

I setup a delegate for it and assign a Selector to handle the event.

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

The Code

 
Goal
Show and hide a toolbar at the bottom of the view when the user taps.

Why
Several apps, particularly those focus on reading the content in the view, offer a UIToolbar (or a custom component with buttons) at the bottom of the view that shows or hides according to the user&#8217;s taps.

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

How
Using a UITapGestureRecognizer we can handle taps on the UIWebView. 

I setup a delegate for it and assign a Selector to handle the event.

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

The Code

 

&amp;nbsp;</description>
      <dc:subject>iPhone, MonoTouch</dc:subject>
      <dc:date>2012-05-01T01:03:06+00:00</dc:date>
    </item>

    <item>
      <title>MonoTouch: Handle Events from UIWebView</title>
      <link>http://www.davidortinau.com/site/monotouch_handle_events_from_uiwebview/</link>
      <guid>http://www.davidortinau.com/site/monotouch_handle_events_from_uiwebview/#When:00:34:21Z</guid>
      <description>Goal
Handle taps on buttons and links within a UIWebView.

Why
I really like how Readability, Pinterest and other apps hide or altogether don&#8217;t use a visible UINavigationBar on appropriate views. 

 

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

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

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.



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.



How
UIWebView provides ShouldStartLoad where we can see what the component is about to load. At that point we can intercept the request and take a different action.

The Code: 


 

In the HTML I have a link to the anchor #back like this:

&amp;nbsp;&amp;lt;a href=&amp;quot;#back&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;Images/btn_back.png&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt;&amp;nbsp;

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

When the user touches that link the webViewShouldStartLoad handles it and pops the view controller as desired. Goal
Handle taps on buttons and links within a UIWebView.

Why
I really like how Readability, Pinterest and other apps hide or altogether don&#8217;t use a visible UINavigationBar on appropriate views. 

 

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

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

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.



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.



How
UIWebView provides ShouldStartLoad where we can see what the component is about to load. At that point we can intercept the request and take a different action.

The Code: 


 

In the HTML I have a link to the anchor #back like this:

&amp;nbsp;&amp;lt;a href=&amp;quot;#back&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;Images/btn_back.png&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt;&amp;nbsp;

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

When the user touches that link the webViewShouldStartLoad handles it and pops the view controller as desired.</description>
      <dc:subject>iPhone, MonoTouch</dc:subject>
      <dc:date>2012-04-29T00:34:21+00:00</dc:date>
    </item>

    <item>
      <title>Rage Against the Framework: Flash Camp St. Louis Slides and Code</title>
      <link>http://www.davidortinau.com/site/rage_against_the_framework_flash_camp_st._louis_slides_and_code/</link>
      <guid>http://www.davidortinau.com/site/rage_against_the_framework_flash_camp_st._louis_slides_and_code/#When:01:13:36Z</guid>
      <description>We had a wonderful turnout at Flash Camp St. Louis. Most impressive were all of the new faces. JP Revel did a fantastic job putting on the event.

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;

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. 

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.

 Rage Against the Framework   View more presentations from David Ortinau  

References

Data Binding

http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf64c3d&#45;7fff.html#WS2db454920e96a9e51e63e3d11c0bf69084&#45;7cc8

Binding Utils

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/binding/utils/BindingUtils.html

State Transitions

http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084&#45;7fab.html

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/states/Transition.html

Effects

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/effects/package&#45;detail.html

Layouts

http://tv.adobe.com/watch/max&#45;2010&#45;develop/having&#45;fun&#45;with&#45;layouts&#45;in&#45;flex&#45;4/

http://www.rialvalue.com/blog/2010/11/04/slides&#45;for&#45;having&#45;fun&#45;with&#45;layouts&#45;in&#45;flex&#45;4/

http://evtimmy.com/2010/04/two&#45;examples&#45;of&#45;layout&#45;animations/

http://tv.adobe.com/watch/flash&#45;camp&#45;boston/creating&#45;custom&#45;layouts&#45;in&#45;flex&#45;4&#45;

http://miti.pricope.com/2009/05/29/playing&#45;with&#45;custom&#45;layout&#45;in&#45;flex&#45;4/

http://www.tink.ws/blog/carousellayout/

&amp;nbsp;

Code Demo: http://davidortinau.com/exhibits/DataBindingTransitions/index.html

Source: DataBindingTransitions.zip
We had a wonderful turnout at Flash Camp St. Louis. Most impressive were all of the new faces. JP Revel did a fantastic job putting on the event.

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;

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. 

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.

 Rage Against the Framework   View more presentations from David Ortinau  

References

Data Binding

http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf64c3d&#45;7fff.html#WS2db454920e96a9e51e63e3d11c0bf69084&#45;7cc8

Binding Utils

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/binding/utils/BindingUtils.html

State Transitions

http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084&#45;7fab.html

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/states/Transition.html

Effects

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/effects/package&#45;detail.html

Layouts

http://tv.adobe.com/watch/max&#45;2010&#45;develop/having&#45;fun&#45;with&#45;layouts&#45;in&#45;flex&#45;4/

http://www.rialvalue.com/blog/2010/11/04/slides&#45;for&#45;having&#45;fun&#45;with&#45;layouts&#45;in&#45;flex&#45;4/

http://evtimmy.com/2010/04/two&#45;examples&#45;of&#45;layout&#45;animations/

http://tv.adobe.com/watch/flash&#45;camp&#45;boston/creating&#45;custom&#45;layouts&#45;in&#45;flex&#45;4&#45;

http://miti.pricope.com/2009/05/29/playing&#45;with&#45;custom&#45;layout&#45;in&#45;flex&#45;4/

http://www.tink.ws/blog/carousellayout/

&amp;nbsp;

Code Demo: http://davidortinau.com/exhibits/DataBindingTransitions/index.html

Source: DataBindingTransitions.zip</description>
      <dc:subject>General</dc:subject>
      <dc:date>2011-09-17T01:13:36+00:00</dc:date>
    </item>

    <item>
      <title>Practical Interaction Design for Developers: Slides and Code</title>
      <link>http://www.davidortinau.com/site/practical_interaction_design_for_developers_slides_and_code/</link>
      <guid>http://www.davidortinau.com/site/practical_interaction_design_for_developers_slides_and_code/#When:19:53:33Z</guid>
      <description>This summer we had a fantastic Designer/Developer Workflow Conference (D2WC) run by Dee Sadler. 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. 

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.

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 bookshelf.

 Practical IxD for Developers   View more presentations from David Ortinau  

And the code demo from the end of the presentation is below showing basic data binding and how to manage transitions via custom Layouts:

Code Demo: http://davidortinau.com/exhibits/DataBindingTransitions/index.html

Source: DataBindingTransitions.zip
This summer we had a fantastic Designer/Developer Workflow Conference (D2WC) run by Dee Sadler. 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. 

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.

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 bookshelf.

 Practical IxD for Developers   View more presentations from David Ortinau  

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

Code Demo: http://davidortinau.com/exhibits/DataBindingTransitions/index.html

Source: DataBindingTransitions.zip</description>
      <dc:subject>Flex, Interaction Design</dc:subject>
      <dc:date>2011-09-10T19:53:33+00:00</dc:date>
    </item>

    <item>
      <title>Upcoming Speaking Engagements</title>
      <link>http://www.davidortinau.com/site/upcoming_speaking_engagements/</link>
      <guid>http://www.davidortinau.com/site/upcoming_speaking_engagements/#When:22:33:36Z</guid>
      <description>This past May I had the opportunity to present at XPLANE 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.&amp;nbsp; 

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.

July 14&#45;16, 2011 
D2W &#45; Designer To Developer Workflow Conference
Crowne Plaza
Kansas City, MO
http://d2wc.com/
(I can give you a speaker discount, just contact me)

July 20, 2011
Chicago Flex
Chicago, IL
http://chicagoflex.org/

“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.”
&#45; Jarod Spool
This past May I had the opportunity to present at XPLANE 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.&amp;nbsp; 

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.

July 14&#45;16, 2011 
D2W &#45; Designer To Developer Workflow Conference
Crowne Plaza
Kansas City, MO
http://d2wc.com/
(I can give you a speaker discount, just contact me)

July 20, 2011
Chicago Flex
Chicago, IL
http://chicagoflex.org/

“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.”
&#45; Jarod Spool</description>
      <dc:subject>General</dc:subject>
      <dc:date>2011-06-26T22:33:36+00:00</dc:date>
    </item>

    <item>
      <title>Create a Twitter OAuth Application With Tweetr Using Single Access Token</title>
      <link>http://www.davidortinau.com/site/create_a_twitter_oauth_application_with_tweetr_using_single_access_token/</link>
      <guid>http://www.davidortinau.com/site/create_a_twitter_oauth_application_with_tweetr_using_single_access_token/#When:21:25:01Z</guid>
      <description>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. 

Note: the authenticated user in this scenario is you, the owner of the application.

For this example I&#8217;m using Tweetr, an AS3 library for accessing Twitter from your Flash or Flex application. Tweetr requires as3crypto. Details and downloads here: http://wiki.swfjunkie.com/tweetr:downloads

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.

Ok, let&#8217;s get to it.

Create your&#8230; 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. 

Note: the authenticated user in this scenario is you, the owner of the application.

For this example I&#8217;m using Tweetr, an AS3 library for accessing Twitter from your Flash or Flex application. Tweetr requires as3crypto. Details and downloads here: http://wiki.swfjunkie.com/tweetr:downloads

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.

Ok, let&#8217;s get to it.

Create a Twitter Application, 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: http://dev.twitter.com/pages/oauth_single_token

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

&amp;nbsp;var serviceHost : String = &amp;quot;http://your_twittr_proxy_php_setup&amp;quot;;&amp;nbsp;var tweetr:Tweetr = new Tweetr&#40;&#41;;tweetr.serviceHost = serviceHost;           &amp;nbsp;oauth = new OAuth&#40;&#41;;oauth.serviceHost = serviceHost;&amp;nbsp;oauth.consumerKey = &amp;quot;CONSUMER_KEY&amp;quot;;oauth.consumerSecret = &amp;quot;CONSUMER_SECRET&amp;quot;;oauth.oauthToken = &amp;quot;MY_ACCESS_TOKEN&amp;quot;;oauth.oauthTokenSecret = &amp;quot;MY_ACCESS_TOKEN_SECRET&amp;quot;;tweetr.oAuth = oauth;    &amp;nbsp; 


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

&amp;nbsp;tweetr.addEventListener&#40;TweetEvent.COMPLETE, handleLoad&#41;;tweetr.addEventListener&#40;TweetEvent.FAILED, handleFail&#41;;tweetr.getUserTimeLine&#40;null, null, null, 0, 0&#41;;&amp;nbsp;

&amp;nbsp;var tweets:Array = &#91;&#93;;private function handleLoad&#40;event:TweetEvent&#41;:void&#123;        for&#40;var i:int = 0; i &amp;lt; event.responseArray.length; i++&#41;        &#123;            var statusData:StatusData = event.responseArray&#91;i&#93;;            tweets.push&#40;statusData&#41;;        &#125;    // ... do something magical with the tweets&#125;&amp;nbsp;private function handleFail&#40;event:TweetEvent&#41;:void&#123;     trace&#40;&amp;quot;Failed to get data&amp;quot;&#41;;     // ... handle the disappointing failure...maybe a whale...just a thought&#125;&amp;nbsp;

There are plenty of good tutorials out for using Tweetr, though beware of any too old. Twitter phased out basic authentication August 2010. 

A couple I checked out:
Mark Doherty: Tweetr App Video Walkthrough
swfjunkie: PINless OAuth with Tweetr

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.</description>
      <dc:subject>Flash, Flex, AIR</dc:subject>
      <dc:date>2011-01-20T21:25:01+00:00</dc:date>
    </item>

    <item>
      <title>Draw Lines Under Text in Spark RichEditableText</title>
      <link>http://www.davidortinau.com/site/draw_lines_under_text_in_spark_richeditabletext/</link>
      <guid>http://www.davidortinau.com/site/draw_lines_under_text_in_spark_richeditabletext/#When:19:26:36Z</guid>
      <description>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 no 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.

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

I had a nagging feeling I&#8217;d talked to someone about a workable solution, but I couldn&#8217;t remember who. Paul Taylor (@guyinthechair) had shown me some of his excellent work with text during 360|Flex 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! 

Paul extends RichEditableText 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!

&amp;nbsp;package&#123;	import flash.display.DisplayObject;	import flash.display.Shape;	import flash.events.Event;	import flash.events.EventPhase;	import flash.text.engine.TextLine;&amp;nbsp;	import spark.components.RichEditableText;&amp;nbsp;	public class LineyRET extends RichEditableText	&#123;		public function LineyRET&#40;&#41;		&#123;			super&#40;&#41;;			addEventListener&#40;Event.ADDED, onChildLineAdded&#41;;		&#125;&amp;nbsp;		private function onChildLineAdded&#40;event:Event&#41;:void		&#123;			var line:TextLine = event.target as TextLine;			if&#40;!line&#41;				return;&amp;nbsp;			if&#40;line.getChildByName&#40;&#39;baseline&#39;&#41;&#41;				return;&amp;nbsp;			var s:Shape = new Shape&#40;&#41;;			s.name = &#39;baseline&#39;;			s.graphics.lineStyle&#40;1, 0xCCCCCC, 0.5&#41;;			s.graphics.moveTo&#40;0, line.descent + 5&#41;;			s.graphics.lineTo&#40;line.specifiedWidth, line.descent + 5&#41;;			s.graphics.endFill&#40;&#41;;			line.addChild&#40;s&#41;;		&#125;	&#125;&#125;&amp;nbsp;


  
  
  
  
  
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   
  
  
  
  
  
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   
   
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   		Either scripts and active content are not permitted to run or Adobe Flash Player version
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   		0.0.0 or greater is not installed.
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   	
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp; 
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp; 
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  

&amp;nbsp;

Melville text courtesy of Fillerati.

View and Download demo source hereOn 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 no 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.

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

I had a nagging feeling I&#8217;d talked to someone about a workable solution, but I couldn&#8217;t remember who. Paul Taylor (@guyinthechair) had shown me some of his excellent work with text during 360|Flex 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! 

Paul extends RichEditableText 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!

&amp;nbsp;package&#123;	import flash.display.DisplayObject;	import flash.display.Shape;	import flash.events.Event;	import flash.events.EventPhase;	import flash.text.engine.TextLine;&amp;nbsp;	import spark.components.RichEditableText;&amp;nbsp;	public class LineyRET extends RichEditableText	&#123;		public function LineyRET&#40;&#41;		&#123;			super&#40;&#41;;			addEventListener&#40;Event.ADDED, onChildLineAdded&#41;;		&#125;&amp;nbsp;		private function onChildLineAdded&#40;event:Event&#41;:void		&#123;			var line:TextLine = event.target as TextLine;			if&#40;!line&#41;				return;&amp;nbsp;			if&#40;line.getChildByName&#40;&#39;baseline&#39;&#41;&#41;				return;&amp;nbsp;			var s:Shape = new Shape&#40;&#41;;			s.name = &#39;baseline&#39;;			s.graphics.lineStyle&#40;1, 0xCCCCCC, 0.5&#41;;			s.graphics.moveTo&#40;0, line.descent + 5&#41;;			s.graphics.lineTo&#40;line.specifiedWidth, line.descent + 5&#41;;			s.graphics.endFill&#40;&#41;;			line.addChild&#40;s&#41;;		&#125;	&#125;&#125;&amp;nbsp;


  
  
  
  
  
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   
  
  
  
  
  
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   
   
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   		Either scripts and active content are not permitted to run or Adobe Flash Player version
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   		0.0.0 or greater is not installed.
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   	
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp; 
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp; 
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;   
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  

&amp;nbsp;

Melville text courtesy of Fillerati.

View and Download demo source here</description>
      <dc:subject>Flex</dc:subject>
      <dc:date>2011-01-15T19:26:36+00:00</dc:date>
    </item>

    <item>
      <title>Flex 4 States: The Default State?</title>
      <link>http://www.davidortinau.com/site/flex_4_states_the_default_state/</link>
      <guid>http://www.davidortinau.com/site/flex_4_states_the_default_state/#When:16:26:44Z</guid>
      <description>You can call the first state in your list of states the default as Adobe&#8217;s Kevin Hoyt does in his article about States, and as Stephen Gilson does in his Flex Doc article, but don&#8217;t expect it to always have your back. I found this out the usual way, I assumed and failed.

The Actionscript 3.0 reference docs for mx.states.State don&#8217;t clarify this issue, though it does make one reference to a &#8220;default view state&#8221;.

Let&#8217;s say you have a component with 3 states:

&amp;nbsp;&amp;lt;s:states&amp;gt;	&amp;lt;s:State name=&amp;quot;welcome&amp;quot;/&amp;gt;	&amp;lt;s:State name=&amp;quot;top_products&amp;quot;/&amp;gt;	&amp;lt;s:State name=&amp;quot;all_products&amp;quot;/&amp;gt;&amp;lt;/s:states&amp;gt;&amp;nbsp;


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

&amp;nbsp;&amp;lt;s:DataGroup id=&amp;quot;productsDataGroup&amp;quot;	 dataProvider=&amp;quot;{allProducts}&amp;quot;	 dataProvider.top_products=&amp;quot;{topProducts}&amp;quot; 	... /&amp;gt;&amp;nbsp;


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. 

BUT&#8230;

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. 

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

&amp;nbsp;&amp;lt;s:DataGroup id=&amp;quot;productsDataGroup&amp;quot;	 dataProvider=&amp;quot;{allProducts}&amp;quot;	 dataProvider.welcome=&amp;quot;{allProducts}&amp;quot;	 dataProvider.top_products=&amp;quot;{topProducts}&amp;quot; 	 dataProvider.all_products=&amp;quot;{allProducts}&amp;quot;	... /&amp;gt;&amp;nbsp;


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.

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.

Thanks to @jamespolanco, @pollensoft, @derrickgrigg, @benjamminSTL, and @flexmonkeypatch for your contributions to the discussion.You can call the first state in your list of states the default as Adobe&#8217;s Kevin Hoyt does in his article about States, and as Stephen Gilson does in his Flex Doc article, but don&#8217;t expect it to always have your back. I found this out the usual way, I assumed and failed.

The Actionscript 3.0 reference docs for mx.states.State don&#8217;t clarify this issue, though it does make one reference to a &#8220;default view state&#8221;.

Let&#8217;s say you have a component with 3 states:

&amp;nbsp;&amp;lt;s:states&amp;gt;	&amp;lt;s:State name=&amp;quot;welcome&amp;quot;/&amp;gt;	&amp;lt;s:State name=&amp;quot;top_products&amp;quot;/&amp;gt;	&amp;lt;s:State name=&amp;quot;all_products&amp;quot;/&amp;gt;&amp;lt;/s:states&amp;gt;&amp;nbsp;


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

&amp;nbsp;&amp;lt;s:DataGroup id=&amp;quot;productsDataGroup&amp;quot;	 dataProvider=&amp;quot;{allProducts}&amp;quot;	 dataProvider.top_products=&amp;quot;{topProducts}&amp;quot; 	... /&amp;gt;&amp;nbsp;


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. 

BUT&#8230;

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. 

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

&amp;nbsp;&amp;lt;s:DataGroup id=&amp;quot;productsDataGroup&amp;quot;	 dataProvider=&amp;quot;{allProducts}&amp;quot;	 dataProvider.welcome=&amp;quot;{allProducts}&amp;quot;	 dataProvider.top_products=&amp;quot;{topProducts}&amp;quot; 	 dataProvider.all_products=&amp;quot;{allProducts}&amp;quot;	... /&amp;gt;&amp;nbsp;


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.

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.

Thanks to @jamespolanco, @pollensoft, @derrickgrigg, @benjamminSTL, and @flexmonkeypatch for your contributions to the discussion.</description>
      <dc:subject>Flex</dc:subject>
      <dc:date>2010-12-16T16:26:44+00:00</dc:date>
    </item>

    <item>
      <title>Spark States and Transitions: Working in Concert</title>
      <link>http://www.davidortinau.com/site/spark_states_and_transitions_working_in_concert/</link>
      <guid>http://www.davidortinau.com/site/spark_states_and_transitions_working_in_concert/#When:21:16:07Z</guid>
      <description>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.

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. 

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?

A component will receive addedToStage or removedFromStage events when its parent changes state and the component is included or excluded from that state. 

Scenario
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. 

Problem
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.

Solution
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;
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.

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. 

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?

Note: A component will receive addedToStage or removedFromStage events when its parent changes state and the component is included or excluded from that state. 

Scenario
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. 

Problem
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.

Solution
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;


&amp;nbsp;&amp;lt;s:states&amp;gt;&amp;lt;s:State name=&amp;quot;state1&amp;quot; /&amp;gt;&amp;lt;s:State name=&amp;quot;state2&amp;quot; /&amp;gt;&amp;lt;/s:states&amp;gt;&amp;lt;s:transitions&amp;gt;&amp;lt;s:Transition fromState=&amp;quot;state2&amp;quot; toState=&amp;quot;*&amp;quot;&#93;&#93;&amp;gt;&amp;lt;s:Sequence&amp;gt;&amp;lt;s:SetAction target=&amp;quot;{logo}&amp;quot; property=&amp;quot;currentState&amp;quot; value=&amp;quot;hidden&amp;quot;/&amp;gt;&amp;lt;s:Pause target=&amp;quot;{logo}&amp;quot; eventName=&amp;quot;{Logo.TRANSITIONED_OUT}&amp;quot; /&amp;gt; &amp;lt;s:RemoveAction target=&amp;quot;{logo}&amp;quot; /&amp;gt;&amp;lt;/s:Sequence&amp;gt;&amp;lt;/s:Transition&amp;gt;&amp;lt;/s:transitions&amp;gt;&amp;nbsp;


... 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.


&amp;nbsp;&amp;lt;s:Transition fromState=&amp;quot;visible&amp;quot; toState=&amp;quot;*&amp;quot; autoReverse=&amp;quot;true&amp;quot;&#93;&#93;&amp;gt;&amp;lt;s:Sequence&amp;gt;&amp;lt;s:Parallel id=&amp;quot;outTransition&amp;quot; duration=&amp;quot;500&amp;quot;&#93;&#93;&amp;gt;&amp;lt;s:Fade target=&amp;quot;{simplyProfoundLogo}&amp;quot; alphaFrom=&amp;quot;1&amp;quot; alphaTo=&amp;quot;0&amp;quot; /&amp;gt;&amp;lt;s:Move target=&amp;quot;{simplyProfoundLogo}&amp;quot; xTo=&amp;quot;600&amp;quot; /&amp;gt;&amp;lt;/s:Parallel&amp;gt;&amp;lt;s:CallAction target=&amp;quot;{this}&amp;quot; functionName=&amp;quot;dispatchEvent&amp;quot; args=&amp;quot;{[new Event(TRANSITIONED_OUT)]}&amp;quot; /&amp;gt;&amp;lt;/s:Sequence&amp;gt;&amp;lt;/s:Transition&amp;gt;&amp;nbsp;


Download Source: SparkStateTransitions.fxp

Big thanks to @_leonardsouza_, @s9tpepper, @john__olson, @polygeek, @jesterxl, and @terencecarroll for helping me out.

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.

Examples and Resources
Leonard Souza: Flexerific Visual Effects (highly recommend his video from 360|Flex DC)

Chet Haase on Spark Effects. SVFUG recording: http://goo.gl/7EWhA

Chet Haase Flex 4 Fun book: http://goo.gl/ooC5W Discount code: FUG1

Jacob Surber on Flex Skins/FXG. SVFUG recording: http://goo.gl/nFdst

Custom Components in Flex 4 presentation by @mrinal: http://weblog.mrinalwadhwa.com/2009/12/01/custom&#45;components&#45;in&#45;flex&#45;4/

Dan Florio&#8216;s posts on Flex 4 State transitions: http://polygeek.com/2304_flex_simple&#45;flex&#45;4&#45;component&#45;checkedunchecked and http://polygeek.com/2506_flex_using&#45;wildcards&#45;in&#45;flex&#45;4&#45;state&#45;transitions</description>
      <dc:subject>Flex</dc:subject>
      <dc:date>2010-12-12T21:16:07+00:00</dc:date>
    </item>

    <item>
      <title>Flex Hero Gotcha: Application Freeze on navigator.popView and navigator.popToFirstView</title>
      <link>http://www.davidortinau.com/site/flex_hero_gotcha_application_freeze/</link>
      <guid>http://www.davidortinau.com/site/flex_hero_gotcha_application_freeze/#When:15:02:14Z</guid>
      <description>I&#8217;ve been spending a lot of time in Flex &#8220;Hero&#8221; preview release 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. 

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

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

How to Reproduce It
If you are using the Employee Directory from the sample apps 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. 

&amp;nbsp;&amp;lt;s:actionContent&amp;gt;          &amp;lt;s:TextInput id=&amp;quot;searchKey&amp;quot; width=&amp;quot;{width &#45; searchBtn.width &#45; 16}&amp;quot;                          text=&amp;quot;{SEARCH_TEXT}&amp;quot; focusIn=&amp;quot;searchKey.text=&#39;&#39;&amp;quot; enter=&amp;quot;search()&amp;quot;/&amp;gt;          &amp;lt;s:Button id=&amp;quot;searchBtn&amp;quot; icon=&amp;quot;@Embed(&#39;assets/search.png&#39;)&amp;quot;                      click=&amp;quot;search()&amp;quot;/&amp;gt;     &amp;lt;/s:actionContent&amp;gt;&amp;nbsp;

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.

&amp;nbsp;&amp;lt;s:HGroup paddingLeft=&amp;quot;8&amp;quot; paddingTop=&amp;quot;0&amp;quot; gap=&amp;quot;8&amp;quot; verticalAlign=&amp;quot;middle&amp;quot; width=&amp;quot;100%&amp;quot; height=&amp;quot;80&amp;quot;&#93;&#93; &amp;gt;  &amp;lt;s:TextInput id=&amp;quot;searchKey&amp;quot; width=&amp;quot;{width &#45; searchBtn.width &#45; 16}&amp;quot;                          text=&amp;quot;{SEARCH_TEXT}&amp;quot; focusIn=&amp;quot;searchKey.text=&#39;&#39;&amp;quot; enter=&amp;quot;search()&amp;quot;/&amp;gt;          &amp;lt;s:Button id=&amp;quot;searchBtn&amp;quot; icon=&amp;quot;@Embed(&#39;assets/search.png&#39;)&amp;quot;                      click=&amp;quot;search()&amp;quot;/&amp;gt;&amp;lt;/s:HGroup&amp;gt;&amp;nbsp;


Workaround
With the keen eye and assistance of Jason Hanson, 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.

&amp;nbsp;&amp;lt;s:HGroup paddingLeft=&amp;quot;8&amp;quot; paddingTop=&amp;quot;0&amp;quot; gap=&amp;quot;8&amp;quot; verticalAlign=&amp;quot;middle&amp;quot; width=&amp;quot;100%&amp;quot; height=&amp;quot;80&amp;quot;&#93;&#93; &amp;gt; &amp;lt;s:TextInput id=&amp;quot;searchKey&amp;quot; width=&amp;quot;100%&amp;quot; text=&amp;quot;{SEARCH_TEXT}&amp;quot; focusIn=&amp;quot;searchKey.text=&#39;&#39;&amp;quot; enter=&amp;quot;search()&amp;quot; /&amp;gt;&amp;lt;s:Button id=&amp;quot;searchBtn&amp;quot; icon=&amp;quot;@Embed(&#39;assets/search.png&#39;)&amp;quot;              click=&amp;quot;search()&amp;quot;/&amp;gt;&amp;lt;/s:HGroup&amp;gt;&amp;nbsp;

I&#8217;ve logged a JIRA bug for this issue.

Hero is definitely prerelease and this is one example of where that shows up. 

I highly recommend you check out the Shopping Cart Application for Web and Mobile to see more advanced solutions. Thanks Jason!


I&#8217;ve been spending a lot of time in Flex &#8220;Hero&#8221; preview release 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. 

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

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

How to Reproduce It
If you are using the Employee Directory from the sample apps 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. 

&amp;nbsp;&amp;lt;s:actionContent&amp;gt;          &amp;lt;s:TextInput id=&amp;quot;searchKey&amp;quot; width=&amp;quot;{width &#45; searchBtn.width &#45; 16}&amp;quot;                          text=&amp;quot;{SEARCH_TEXT}&amp;quot; focusIn=&amp;quot;searchKey.text=&#39;&#39;&amp;quot; enter=&amp;quot;search()&amp;quot;/&amp;gt;          &amp;lt;s:Button id=&amp;quot;searchBtn&amp;quot; icon=&amp;quot;@Embed(&#39;assets/search.png&#39;)&amp;quot;                      click=&amp;quot;search()&amp;quot;/&amp;gt;     &amp;lt;/s:actionContent&amp;gt;&amp;nbsp;

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.

&amp;nbsp;&amp;lt;s:HGroup paddingLeft=&amp;quot;8&amp;quot; paddingTop=&amp;quot;0&amp;quot; gap=&amp;quot;8&amp;quot; verticalAlign=&amp;quot;middle&amp;quot; width=&amp;quot;100%&amp;quot; height=&amp;quot;80&amp;quot;&#93;&#93; &amp;gt;  &amp;lt;s:TextInput id=&amp;quot;searchKey&amp;quot; width=&amp;quot;{width &#45; searchBtn.width &#45; 16}&amp;quot;                          text=&amp;quot;{SEARCH_TEXT}&amp;quot; focusIn=&amp;quot;searchKey.text=&#39;&#39;&amp;quot; enter=&amp;quot;search()&amp;quot;/&amp;gt;          &amp;lt;s:Button id=&amp;quot;searchBtn&amp;quot; icon=&amp;quot;@Embed(&#39;assets/search.png&#39;)&amp;quot;                      click=&amp;quot;search()&amp;quot;/&amp;gt;&amp;lt;/s:HGroup&amp;gt;&amp;nbsp;


Workaround
With the keen eye and assistance of Jason Hanson, 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.

&amp;nbsp;&amp;lt;s:HGroup paddingLeft=&amp;quot;8&amp;quot; paddingTop=&amp;quot;0&amp;quot; gap=&amp;quot;8&amp;quot; verticalAlign=&amp;quot;middle&amp;quot; width=&amp;quot;100%&amp;quot; height=&amp;quot;80&amp;quot;&#93;&#93; &amp;gt; &amp;lt;s:TextInput id=&amp;quot;searchKey&amp;quot; width=&amp;quot;100%&amp;quot; text=&amp;quot;{SEARCH_TEXT}&amp;quot; focusIn=&amp;quot;searchKey.text=&#39;&#39;&amp;quot; enter=&amp;quot;search()&amp;quot; /&amp;gt;&amp;lt;s:Button id=&amp;quot;searchBtn&amp;quot; icon=&amp;quot;@Embed(&#39;assets/search.png&#39;)&amp;quot;              click=&amp;quot;search()&amp;quot;/&amp;gt;&amp;lt;/s:HGroup&amp;gt;&amp;nbsp;

I&#8217;ve logged a JIRA bug for this issue.

Hero is definitely prerelease and this is one example of where that shows up. 

I highly recommend you check out the Shopping Cart Application for Web and Mobile to see more advanced solutions. Thanks Jason!</description>
      <dc:subject>Flex, AIR</dc:subject>
      <dc:date>2010-10-28T15:02:14+00:00</dc:date>
    </item>

    
    </channel>
</rss>
