<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SmartLogic Solutions Blog &#187; Greg Jastrab</title>
	<atom:link href="http://blog.smartlogicsolutions.com/author/gjastrab/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.smartlogicsolutions.com</link>
	<description>News and updates from the people at SmartLogic Solutions</description>
	<lastBuildDate>Tue, 30 Nov 2010 21:39:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Flex 4 Login Form Component</title>
		<link>http://blog.smartlogicsolutions.com/2009/05/28/flex-4-login-form-component/</link>
		<comments>http://blog.smartlogicsolutions.com/2009/05/28/flex-4-login-form-component/#comments</comments>
		<pubDate>Thu, 28 May 2009 16:59:08 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Login Form]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=665</guid>
		<description><![CDATA[It&#8217;s been a while since I&#8217;ve gotten to blog about Flex 4/Gumbo, and with some exciting news likely coming tomorrow I figured it was time to get back on track. I wanted to think of an example of something that may be frequently used across Flex/AIR projects that will greatly benefit from the Flex 4 [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I&#8217;ve gotten to blog about Flex 4/Gumbo, and with some exciting news <a href="http://www.flashcamp.org/2009/05/27/flashcamp-san-francisco-is-in-two-days/">likely coming tomorrow</a> I figured it was time to get back on track.  I wanted to think of an example of something that may be frequently used across Flex/AIR projects that will greatly benefit from the Flex 4 architecture and a Login Form seemed like a good place to start.  So today we&#8217;ll review a <a href="http://github.com/gjastrab/flex4-login-form">Login Form component</a> I created in Flex 4.  Follow the link to checkout the code from GitHub.</p>
<p><b>NOTE:</b> This code was compiled using the 7297 revision of the <a href="http://opensource.adobe.com/svn/opensource/flex/sdk/trunk/">Gumbo SDK trunk</a>.<br />
<span id="more-665"></span><br />
The LoginForm component extends <a href="http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Skinning">SkinnableComponent</a> and defines the 3 states (<b>login</b>, <b>loggingIn</b>, and <b>loggedIn</b>) &#038; various skin parts.  Lets dive into the example skin for the component.</p>
<h3>com.smartlogicsolutions.skins.LoginFormSkin</h3>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:Skin</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span> <span style="color: #000066;">xmlns:s</span>=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Metadata<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    [HostComponent(&quot;com.smartlogicsolutions.components.LoginForm&quot;)]
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Metadata<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:states<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:State</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;login&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:State</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;loggingIn&quot;</span> <span style="color: #000066;">stateGroups</span>=<span style="color: #ff0000;">&quot;notLogin&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:State</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;loggedIn&quot;</span> <span style="color: #000066;">stateGroups</span>=<span style="color: #ff0000;">&quot;notLogin&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:states<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:VGroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:HGroup</span> <span style="color: #000066;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">verticalAlign</span>=<span style="color: #ff0000;">&quot;middle&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:SimpleText</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;loginFieldLabel&quot;</span> <span style="color: #000066;">fontWeight</span>=<span style="color: #ff0000;">&quot;bold&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:TextInput</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;loginField&quot;</span> <span style="color: #000066;">enabled.notLogin</span>=<span style="color: #ff0000;">&quot;false&quot;</span>  <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:HGroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:HGroup</span> <span style="color: #000066;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">verticalAlign</span>=<span style="color: #ff0000;">&quot;middle&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:SimpleText</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;passwordFieldLabel&quot;</span> <span style="color: #000066;">fontWeight</span>=<span style="color: #ff0000;">&quot;bold&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:TextInput</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;passwordField&quot;</span> <span style="color: #000066;">enabled.notLogin</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:HGroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:Button</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;loginButton&quot;</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Login&quot;</span> <span style="color: #000066;">enabled.notLogin</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:SimpleText</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;loginMessage&quot;</span> <span style="color: #000066;">excludeFrom</span>=<span style="color: #ff0000;">&quot;login&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;{hostComponent.loginMessageLabel}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:VGroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:Skin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>The skin provides the essentials for a login form: labels, input boxes, a button, and a label to display what is going on.  This skin provides all of the skin parts the LoginForm may display.  Of course, the only things a login form <b>must</b> have are the input fields and a button, so these are the only required parts of the component, as seen in this excerpt of the LoginForm component:</p>
<h3>(excerpt) com.smartlogicsolutions.components.LoginForm</h3>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&#91;</span>SkinPart<span style="color: #66cc66;">&#93;</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> loginButton:<span style="color: #0066CC;">Button</span>;
&nbsp;
<span style="color: #66cc66;">&#91;</span>SkinPart<span style="color: #66cc66;">&#93;</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> loginField:TextInput;
&nbsp;
<span style="color: #66cc66;">&#91;</span>SkinPart<span style="color: #66cc66;">&#93;</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> passwordField:TextInput;</pre></div></div>

<p>The labels are all decorated as being optional with the <code>[SkinPart(required="false")]</code> metadata, so any custom skin you provide for the Login Form doesn&#8217;t have to include the labels if you don&#8217;t desire.</p>
<p>Once you click the login button, the component puts itself into the <b>loggingIn</b> state and an associated event is dispatched.  At this point you would call your service to execute the login, and eventually notify the form the result of the login action.  So as for now, in this version of the component, you&#8217;ll need to explicitly call <code>loginSucceeded()</code> or <code>loginFailed()</code> on the LoginForm instance to signal the result.</p>
<p>Since this is a Flex 4 component, and the view &#038; layout is decoupled from the LoginForm itself, it&#8217;s dead simple to re-purpose this component across various applications and apply drastically different styles and layouts for all of them.  And the only thing that needs to happen is creating another Skin, and specifying that skin when including the LoginForm in your application.  Look at the test application file that comes with this component to see how the skin is connected to the form:</p>
<h3>TestLoginApplication.mxml</h3>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:Application</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #009900;">               <span style="color: #000066;">xmlns:s</span>=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #009900;">               <span style="color: #000066;">xmlns:sls</span>=<span style="color: #ff0000;">&quot;com.smartlogicsolutions.components.*&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    private function enableButtons(doEnable:Boolean):void {
      btn.enabled = failBtn.enabled = doEnable;
    }
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:layout<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:VerticalLayout</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:layout<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sls:LoginForm</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;loginForm&quot;</span></span>
<span style="color: #009900;">                 <span style="color: #000066;">skinClass</span>=<span style="color: #ff0000;">&quot;com.smartlogicsolutions.skins.LoginFormSkin&quot;</span></span>
<span style="color: #009900;">                 <span style="color: #000066;">loginLabel</span>=<span style="color: #ff0000;">&quot;Login:&quot;</span> <span style="color: #000066;">loggedInMessage</span>=<span style="color: #ff0000;">&quot;Sweet, logged in!&quot;</span></span>
<span style="color: #009900;">                 <span style="color: #000066;">login</span>=<span style="color: #ff0000;">&quot;enableButtons(true)&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:HGroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:Button</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;btn&quot;</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Set Login Success&quot;</span> <span style="color: #000066;">enabled</span>=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #009900;">              <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;loginForm.loginSucceeded(); enableButtons(false)&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:Button</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;failBtn&quot;</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Set Login Failed&quot;</span> <span style="color: #000066;">enabled</span>=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #009900;">              <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;loginForm.loginFailed(); enableButtons(false)&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:Button</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;updateLoggingInMessage&quot;</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Update Logging In Message&quot;</span></span>
<span style="color: #009900;">              <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;loginForm.loggingInMessage = 'Trying to login'&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:HGroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:Application<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>The <code>skinClass</code> property of the LoginForm component will register a skin with the component.  In the future, this component would be bundled into a SWC that would apply the skin I&#8217;ve provided by default, but for now you&#8217;ll need to explicitly apply a <code>skinClass</code> to the component.</p>
<p>I haven&#8217;t figured out how to properly embed Flash 10 SWFs in wordpress w/o breaking the page for users that don&#8217;t have it installed, but click through to <a href="http://blog.smartlogicsolutions.com/wp-content/uploads/2009/05/testloginapplication.swf">see the TestLoginApplication</a> in action.</p>
<p>Future features of this component and example will include:</p>
<ul>
<li>validations on the input fields</li>
<li><a href="http://opensource.adobe.com/wiki/display/flexunit/FlexUnit">FlexUnit4</a> tests</li>
<li>transitions between the states to demo some Spark effects</li>
<li>an extended RegistrationForm class</li>
</ul>
<p>Enjoy!</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/07/16/skinning-button-flex-4-fxg/" rel="bookmark" class="crp_title">Skinning A Button in Flex 4 Using FXG</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/07/19/creating-custom-flex-4-skinnable-component/" rel="bookmark" class="crp_title">Creating Your First Custom SkinnableComponent in Flex 4</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/10/08/new-flex-4-theme-and-class-renaming/" rel="bookmark" class="crp_title">New Flex 4 Theme and Class Renaming</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/09/25/rotate-effect-and-non-embedded-fonts-in-flex-4/" rel="bookmark" class="crp_title">Rotate Effect and Non Embedded Fonts in Flex 4</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/08/16/recreating-elys-flex-4-list-component-series/" rel="bookmark" class="crp_title">Recreating Ely&#8217;s Flex 4 List Component Series</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2009/05/28/flex-4-login-form-component/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Properly Setting HTTP_REFERER in a Rails Integration Test for a File Upload</title>
		<link>http://blog.smartlogicsolutions.com/2009/02/03/properly-setting-http_referer-in-a-rails-integration-test-to-upload-file/</link>
		<comments>http://blog.smartlogicsolutions.com/2009/02/03/properly-setting-http_referer-in-a-rails-integration-test-to-upload-file/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 00:38:01 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[file upload]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=495</guid>
		<description><![CDATA[This one had me frustrated for the past hour. I&#8217;ve been writing integration tests for a Rails project and got stuck on an error when I was trying to test that a file upload worked successfully and asserted a redirection was occuring correctly, but ran into the following error: Expected response to be a &#60;:redirect&#62;, [...]]]></description>
			<content:encoded><![CDATA[<p>This one had me frustrated for the past hour.  I&#8217;ve been writing integration tests for a Rails project and got stuck on an error when I was trying to test that a file upload worked successfully and asserted a redirection was occuring correctly, but ran into the following error:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;">Expected response to be a <span style="color:#006600; font-weight:bold;">&lt;</span>:redirect<span style="color:#006600; font-weight:bold;">&gt;</span>, but was <span style="color:#006600; font-weight:bold;">&lt;</span><span style="color:#006666;">500</span><span style="color:#006600; font-weight:bold;">&gt;</span>
<span style="color:#006600; font-weight:bold;">&lt;</span><span style="color:#996600;">&quot;No HTTP_REFERER was set in the request to this action, so
redirect_to :back could not be called successfully. If this
is a test, make sure to specify
request.env[<span style="color:#000099;">\&quot;</span>HTTP_REFERER<span style="color:#000099;">\&quot;</span>].&quot;</span><span style="color:#006600; font-weight:bold;">&gt;</span></pre></div></div>

<p>What a lovely error message to send me on a goose chase trying to set HTTP_REFERER directly on the @request as instructed.</p>
<h4>Did Not Work</h4>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#0066ff; font-weight:bold;">@request</span>.<span style="color:#9900CC;">env</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;HTTP_REFERER&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#996600;">'/'</span>
post upload_path, <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:file</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> fixture_file_upload<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;worddoc.docx&quot;</span>, <span style="color:#996600;">&quot;application/msword&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>,
  <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:html</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>:multipart <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
assert_redirected_to <span style="color:#996600;">'/'</span>, <span style="color:#996600;">'index'</span></pre></div></div>

<p>This continued to spit out the same error.  I finally stumbled across <a href="http://redsquirrel.com/cgi-bin/dave/2006/08/index.html">a post back from 2006</a> that held the answer.  The HTTP_REFERER is not set the same way in an integration test:</p>
<h4>Success!</h4>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">post upload_path, <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:file</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> fixture_file_upload<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;worddoc.docx&quot;</span>, <span style="color:#996600;">&quot;application/msword&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>,
  <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:html</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>:multipart <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#125;</span>, <span style="color:#ff3333; font-weight:bold;">:referer</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'/'</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
assert_redirected_to <span style="color:#996600;">'/'</span>, <span style="color:#996600;">'index'</span></pre></div></div>

<p>Hope that saves anyone else some time if you encounter this error.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2007/06/12/struts-11-problems-with-logiciterate-tags-and-cannot-find-bean-xxx-under-any-scope/" rel="bookmark" class="crp_title">Struts 1.1: Problems with logic:iterate tags and &#8220;Cannot find bean XXX under any scope&#8221;</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/08/08/using-active-x-and-javascript-to-scan-from-your-web-app/" rel="bookmark" class="crp_title">using active x and javascript to scan from your web app</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/06/23/dont-abuse-the-session/" rel="bookmark" class="crp_title">Don&#8217;t Abuse the Session</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/10/26/testpilot-rails-integration-testing-pattern/" rel="bookmark" class="crp_title">TestPilot &#8211; Rails Integration Testing Pattern</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/06/15/automating-flex-compilation-using-ant/" rel="bookmark" class="crp_title">Automating Flex Compilation Using ANT</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2009/02/03/properly-setting-http_referer-in-a-rails-integration-test-to-upload-file/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PureMVCGen 0.1.1 Released &#8211; Now Works on Windows</title>
		<link>http://blog.smartlogicsolutions.com/2008/12/18/puremvcgen-011-released-now-works-on-windows/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/12/18/puremvcgen-011-released-now-works-on-windows/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 22:47:49 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[PureMVC]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[generator]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=441</guid>
		<description><![CDATA[I just released a minor update to PureMVCGen to fix a bug the original release had that caused the ANT commands to fail on Windows. If you&#8217;ve already installed the gem before, then simply run: $&#62; gem update puremvc-gen to get the new version. If you&#8217;re installing for the first time, refer to the original [...]]]></description>
			<content:encoded><![CDATA[<p>I just released a minor update to <a href="http://github.com/gjastrab/puremvc-gen/tree/master">PureMVCGen</a> to fix a bug the original release had that caused the ANT commands to fail on Windows.  If you&#8217;ve already installed the gem before, then simply run:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$<span style="color: #000000; font-weight: bold;">&gt;</span> gem update puremvc-gen</pre></div></div>

<p>to get the new version.  If you&#8217;re installing for the first time, refer to the <a href="http://blog.smartlogicsolutions.com/2008/12/05/introducing-puremvcgen-an-ant-based-puremvc-flex-generator/">original blog</a> post for instructions.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/12/05/introducing-puremvcgen-an-ant-based-puremvc-flex-generator/" rel="bookmark" class="crp_title">Introducing PureMVCGen &#8211; an ANT based PureMVC Flex Generator</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/12/24/timecop-2-released-freeze-and-rebase-time-ruby/" rel="bookmark" class="crp_title">Timecop 0.2.0 Released: Freeze and Rebase Time in Ruby</a></li><li><a href="http://blog.smartlogicsolutions.com/2009/06/10/shell-script-to-upgrade-ruby-enterprise-edition-while-maintaining-directory-naming-sanity/" rel="bookmark" class="crp_title">Shell Script to Upgrade Ruby Enterprise Edition while Maintaining Directory Naming Sanity</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/07/07/i-cant-upgrade-rubygems-from-111-to-120-on-ubuntu/" rel="bookmark" class="crp_title">I can&#8217;t upgrade RubyGems from 1.1.1 to 1.2.0 on Ubuntu</a></li><li><a href="http://blog.smartlogicsolutions.com/2009/12/07/timecop-0-3-4-released/" rel="bookmark" class="crp_title">Timecop 0.3.4 Released</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/12/18/puremvcgen-011-released-now-works-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting git-svn to run on OS X</title>
		<link>http://blog.smartlogicsolutions.com/2008/12/10/getting-git-svn-to-run-on-os-x/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/12/10/getting-git-svn-to-run-on-os-x/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 01:37:20 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=428</guid>
		<description><![CDATA[I&#8217;ve been gitting into git (clever, I know) lately, so I was trying to migrate my git commits for a project back into an existing subversion repository &#8211; another post coming on that later. When trying to run git-svn to import my subversion repository into git I got the following error, followed by a Perl [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been gitting into <a href="http://git.or.cz/">git</a> (clever, I know) lately, so I was trying to migrate my git commits for a project back into an existing subversion repository &#8211; another post coming on that later.</p>
<p>When trying to run <a href="http://www.kernel.org/pub/software/scm/git/docs/git-svn.html">git-svn</a> to import my subversion repository into git I got the following error, followed by a Perl stack trace:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Can<span style="color: #ff0000;">'t locate Term/ReadKey.pm</span></pre></div></div>

<p>A couple of installs got this working, read on&#8230;</p>
<p><span id="more-428"></span></p>
<h4>Install Term::ReadKey</h4>
<p>To install <a href="http://search.cpan.org/dist/TermReadKey/ReadKey.pm">Term::ReadKey</a>, fire up a terminal and type (you may need to sudo):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> shell
cpan<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">install</span> Term::ReadKey</pre></div></div>

<p>After a bunch of output I got the error message:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Writing Makefile <span style="color: #000000; font-weight: bold;">for</span> Term::ReadKey
    <span style="color: #660033;">--</span> NOT OK
Running <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #7a0874; font-weight: bold;">test</span>
  Can<span style="color: #ff0000;">'t test without successful make
Running make install
  make had returned bad status, install seems impossible</span></pre></div></div>

<p>I tried to see what was wrong with the Makefile by trying to run make in the TermKey folder:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">~<span style="color: #000000; font-weight: bold;">/</span>.cpan<span style="color: #000000; font-weight: bold;">/</span>build<span style="color: #000000; font-weight: bold;">/</span>TermReadKey-<span style="color: #000000;">2.30</span> $<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">make</span>
-bash: <span style="color: #c20cb9; font-weight: bold;">make</span>: <span style="color: #7a0874; font-weight: bold;">command</span> not found</pre></div></div>

<p>Interesting, didn&#8217;t realize OS X came preinstalled with things like perl but not make.</p>
<h4>Getting make on OS X</h4>
<p>I&#8217;m sure there&#8217;s an easier way to just get make on OS X, but I&#8217;m still new to my mac, so I wanted to install something supported by Apple instead of getting into stuff like ports.  After searching around on the Developer center I found that <a href="http://developer.apple.com/tools/xcode/">XCode</a> includes make.</p>
<p>After signing up for a free developer account and installing XCode, I now had make.</p>
<h4>Installing Term::ReadKey &#8211; round 2</h4>
<p>Let&#8217;s try this again&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> shell
cpan<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">install</span> Term::ReadKey
&nbsp;
CPAN: Storable loaded ok
Going to <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>greg<span style="color: #000000; font-weight: bold;">/</span>.cpan<span style="color: #000000; font-weight: bold;">/</span>Metadata
  Database was generated on Wed, <span style="color: #000000;">10</span> Dec <span style="color: #000000;">2008</span> <span style="color: #000000;">11</span>:<span style="color: #000000;">26</span>:<span style="color: #000000;">54</span> GMT
Term::ReadKey is up to date.</pre></div></div>

<p>Hurray!  Now git-svn is working on OS X.</p>
<p>Other relevant Mac/Git links:</p>
<ul>
<li><a href="http://code.google.com/p/git-osx-installer/">Git Installer for OS X</a></li>
<li><a href="http://git.or.cz/course/svn.html">Git Crash Course for SVN Users</a></li>
<ul>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/12/01/displaying-an-image-in-a-combobox/" rel="bookmark" class="crp_title">Displaying an Image in a ComboBox</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/02/01/setting-up-ubuntu-9-10-for-ruby-on-rails-development/" rel="bookmark" class="crp_title">Setting Up Ubuntu 9.10 for Ruby On Rails Development</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/08/04/introducing-environmentalize-an-intuitive-environment-focused-config-structure-for-your-rails-applications/" rel="bookmark" class="crp_title">Introducing environmentalist: an intuitive, environment-focused config structure for your rails applications</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/12/05/introducing-puremvcgen-an-ant-based-puremvc-flex-generator/" rel="bookmark" class="crp_title">Introducing PureMVCGen &#8211; an ANT based PureMVC Flex Generator</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/06/07/subversion-timestamps-capistrano-finalize_update/" rel="bookmark" class="crp_title">Subversion Timestamps + Capistrano finalize_update</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/12/10/getting-git-svn-to-run-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing PureMVCGen &#8211; an ANT based PureMVC Flex Generator</title>
		<link>http://blog.smartlogicsolutions.com/2008/12/05/introducing-puremvcgen-an-ant-based-puremvc-flex-generator/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/12/05/introducing-puremvcgen-an-ant-based-puremvc-flex-generator/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 21:47:04 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ANT]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[PureMVC]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=409</guid>
		<description><![CDATA[I just published a PureMVC code generation tool I&#8217;ve been working on lately. It&#8217;s an ANT-based tool, but is distributed via Ruby Gems, which allows it to be easily installed as a command-line tool once you have Ruby, rubygems, and ANT installed. Once you have those programs installed, simply enter ($> just denotes you are [...]]]></description>
			<content:encoded><![CDATA[<p>I just published a <a href="http://www.puremvc.org">PureMVC</a> code generation tool I&#8217;ve been working on lately.  It&#8217;s an ANT-based tool, but is distributed via <a href="http://rubygems.org">Ruby Gems</a>, which allows it to be easily installed as a command-line tool once you have <a href="http://www.ruby-lang.org">Ruby</a>, rubygems, and <a href="http://ant.apache.org">ANT</a> installed.</p>
<p>Once you have those programs installed, simply enter (<code>$></code> just denotes you are at a prompt on the command line)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$<span style="color: #000000; font-weight: bold;">&gt;</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> puremvc-gen</pre></div></div>

<p>and the tool will be installed.  Read on to see how to use it&#8230;</p>
<p><span id="more-409"></span></p>
<h4>Project Settings</h4>
<p>Presently, there is one bit of configuration housekeeping that must be done to get started using the tool.  Within the source directory of your project you will need to add a <b>proj.properties</b> file containing 5 property settings:</p>
<ul>
<li><b>app.prefix</b> =&gt; what to prefix your Facade and application Mediator with</li>
<li><b>project.name</b> =&gt; the name of your main MXML file </li>
<li><b>core.namespace</b> =&gt; the namespace of the project</li>
<li><b>core.dir</b> =&gt; the directory corresponding to the namespace (this will eventually be inferred from <b>core.namespace</b>)</li>
<li><b>pmvc.flavor</b> =&gt; <code>standard</code> | <code>multicore</code> (although only standard is currently supported)</li>
</ul>
<p>An example configuration for a project called <b>MyDemo</b> using the namespace <code>com.mydemo.demo</code> would look like:</p>
<h5>Example proj.properties</h5>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">app.prefix = Demo
project.name = MyDemo
core.namespace = com.mydemo.demo
core.dir = com/mydemo/demo
pmvc.flavor = standard</pre></div></div>

<h4>Using PureMVCGen</h4>
<h5>Validating Project Properties</h5>
<p>If you are starting a new PureMVC project and you have the <b>proj.properties</b> file created in the source directory:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$<span style="color: #000000; font-weight: bold;">&gt;</span> puremvc-gen check</pre></div></div>

<p>will ensure that the properties are correctly set.  If they have been, at the end of the ANT output, you should see:<br />
<div id="attachment_418" class="wp-caption alignnone" style="width: 428px"><img src="http://blog.smartlogicsolutions.com/wp-content/uploads/2008/12/validated.png" alt="Display showing properties have been validated" title="Properties Validated" width="418" height="71" class="size-full wp-image-418" /><p class="wp-caption-text">Display showing properties have been validated</p></div></p>
<h5>Generating the PureMVC Skeleton</h5>
<p>To generate the PureMVC directories, main MXML file, Facade, main Mediator, StartupCommand, and PrepareActorsCommand classes, simply enter:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$<span style="color: #000000; font-weight: bold;">&gt;</span> puremvc-gen init</pre></div></div>

<p>After this was run successfully the directory hierarchy will look something like this:<br />
<div id="attachment_421" class="wp-caption aligncenter" style="width: 284px"><img src="http://blog.smartlogicsolutions.com/wp-content/uploads/2008/12/skeleton.png" alt="PureMVC skeleton generated from demo project properties" title="Generated PureMVC Skeleton" width="274" height="250" class="size-full wp-image-421" /><p class="wp-caption-text">PureMVC skeleton generated from demo project properties</p></div></p>
<h5>Other Commands</h5>
<p>I haven&#8217;t created any online documentation yet, but the tool has fairly decent instructions on the command line.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$<span style="color: #000000; font-weight: bold;">&gt;</span> puremvc-gen <span style="color: #7a0874; font-weight: bold;">help</span></pre></div></div>

<p><a href="http://blog.smartlogicsolutions.com/wp-content/uploads/2008/12/instructions.png"><img src="http://blog.smartlogicsolutions.com/wp-content/uploads/2008/12/instructions.png" alt="Instructions output on command line when running \&quot;help\&quot;" title="PureMVCGen Instructions" width="500" height="127" class="size-full wp-image-423" /></a><br />
A quick rundown of the command, proxy, and mediator generation commands:</p>
<ul>
<li><b>puremvc-gen new command</b> =&gt; generates a simple command</li>
<li><b>puremvc-gen new command -m</b> (or &#8211;macro) =&gt; generates a macro command</li>
<li><b>puremvc-gen new mediator</b> =&gt; generates a mediator</li>
<li><b>puremvc-gen new proxy</b> =&gt; generates a proxy</li>
</ul>
<p>All of these generation commands may be passed a <code>-n</code> option to specify the name for the class on the command line.  Otherwise, ANT will prompt you to input the name.</p>
<h4>Where to Git It</h4>
<p>The project is <a href="http://github.com/gjastrab/puremvc-gen/tree/master">hosted at github</a> so feel free to checkout the source.  I&#8217;ll update the README file eventually so that front page will have documentation as well.</p>
<p>The gem is also <a href="http://rubyforge.org/projects/gjastrab/">hosted at RubyForge</a> so you can download it there if you&#8217;d like to build it manually.</p>
<p>The GitHub page will eventually include a Roadmap for planned features, but please comment here with any suggestions you may have.</p>
<p>Finally, if you&#8217;re averse to Ruby you can always download the <b>conf/</b> directory of the project, and manually run the ANT commands.  They are a bit more cryptic though, which is why the gem and executable it provides are nice, however it should output instructions on what settings need to be made to run it manually.</p>
<p>Enjoy!</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/12/18/puremvcgen-011-released-now-works-on-windows/" rel="bookmark" class="crp_title">PureMVCGen 0.1.1 Released &#8211; Now Works on Windows</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/07/15/compiling-your-first-flex-4-application/" rel="bookmark" class="crp_title">Compiling Your First Flex 4 Application</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/11/12/watch-multiple-logs-in-a-single-terminal/" rel="bookmark" class="crp_title">Watch Multiple Logs in a Single Terminal</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/08/21/getting-subclipse-to-work-in-gandymede-eclipse-34/" rel="bookmark" class="crp_title">Getting Subclipse to Work in Gandymede (Eclipse 3.4)</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/10/14/facebox-with-prototype/" rel="bookmark" class="crp_title">Facebox With Prototype</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/12/05/introducing-puremvcgen-an-ant-based-puremvc-flex-generator/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Displaying an Image in a ComboBox</title>
		<link>http://blog.smartlogicsolutions.com/2008/12/01/displaying-an-image-in-a-combobox/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/12/01/displaying-an-image-in-a-combobox/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 16:17:53 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[ComboBox]]></category>
		<category><![CDATA[Image]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=392</guid>
		<description><![CDATA[I needed to display an Image inside of a ComboBox for a recent project. The image of a selectedItem needed to appear in the ComboBox when it is collapsed and the image needed to be specified as a String. I was surprised that a quick search didn&#8217;t find any components to allow this. The closest [...]]]></description>
			<content:encoded><![CDATA[<p>I needed to display an Image inside of a ComboBox for a recent project.  The image of a selectedItem needed to appear in the ComboBox when it is collapsed and the image needed to be specified as a String.</p>
<p>I was surprised that a quick search didn&#8217;t find any components to allow this.  The closest was a <a href="http://flexibleexperiments.wordpress.com/2007/04/28/flex-201-combobox-with-icon-support/">post by Jason Hawryluk</a>, however this required the image to be embedded into the application.</p>
<p>So I simply extended ComboBox to include an Image within it, and added some sizing calculations so it would respect padding.  An example follows below:<br />
<span id="more-392"></span></p>
<p>[flash http://blog.smartlogicsolutions.com/wp-content/uploads/2008/11/ImageComboBox.swf H=150]</p>
<p>The <a href="http://blog.smartlogicsolutions.com/wp-content/uploads/2008/11/ImageComboBox.as">ImageComboBox class</a> </p>
<ol>
<li>Adds an Image in the <code>createChildren</code> method</li>
<li>Measures the available size the image can take up in the <code>measure</code> method</li>
<li>In the <code>updateDisplayList</code> method, if an item is selected:</li>
<ol>
<li>Sets the source for the Image</li>
<li>Places and sizes the Image based on calculations from <code>measure</code></li>
</ol>
</ol>
<p>In order to prevent the ComboBox from displaying &#8220;[object Object]&#8221; along with the image, be sure to include a label=&#8221;" property on the items in the <code>dataProvider</code> for the ComboBox.  The following code is the MXML main file for the embedded SWF above:</p>
<h4>Example MXML</h4>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">	            xmlns:sls=<span style="color: #ff0000;">&quot;com.slslabs.flex.controls.*&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> text=<span style="color: #ff0000;">&quot;This demonstrates using the ImageComboBox&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;sls:ImageComboBox</span> width=<span style="color: #ff0000;">&quot;60&quot;</span> paddingLeft=<span style="color: #ff0000;">&quot;5&quot;</span> paddingTop=<span style="color: #ff0000;">&quot;5&quot;</span> paddingBottom=<span style="color: #ff0000;">&quot;5&quot;</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;sls:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> url=<span style="color: #ff0000;">&quot;http://www.iconarchive.com/icons/iconshock/mario-bros/mario-32x32.png&quot;</span> label=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> url=<span style="color: #ff0000;">&quot;http://www.iconarchive.com/icons/iconshock/mario-bros/luigui-32x32.png&quot;</span> label=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> url=<span style="color: #ff0000;">&quot;http://www.iconarchive.com/icons/iconshock/mario-bros/start-32x32.png&quot;</span> label=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;/sls:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;sls:itemRenderer</span><span style="color: #7400FF;">&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Component</span><span style="color: #7400FF;">&gt;</span></span>
				<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Image</span> source=<span style="color: #ff0000;">&quot;{data.url}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Component</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;/sls:itemRenderer</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;/sls:ImageComboBox</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>I pushed the code into my first git repository <a href="http://github.com/gjastrab/imagecombobox/tree/master">at github</a>.  If you&#8217;re a git n00b, then after you&#8217;ve <a href="http://www.google.com/search?hl=en&#038;q=install+git&#038;btnG=Google+Search&#038;aq=f&#038;oq=">installed git</a> (or checked out the <a href="http://github.com/guides/using-the-egit-eclipse-plugin-with-github">Git Eclipse Plugin</a> &#8211; which I still need to do) then pull down the code by using the command:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">git clone git://github.com/gjastrab/imagecombobox.git</pre></div></div>

<p>If you aren&#8217;t on the git bandwagon yet, then just right-click and save as&#8230; to download the <a href="http://blog.smartlogicsolutions.com/wp-content/uploads/2008/11/ImageComboBox.as">ImageComboBox.as</a> file for now.</p>
<p>I plan on improving it soon to have it respect the positioning of a label or to optionally hide the label.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/09/25/rotate-effect-and-non-embedded-fonts-in-flex-4/" rel="bookmark" class="crp_title">Rotate Effect and Non Embedded Fonts in Flex 4</a></li><li><a href="http://blog.smartlogicsolutions.com/2009/05/28/flex-4-login-form-component/" rel="bookmark" class="crp_title">Flex 4 Login Form Component</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/07/16/skinning-button-flex-4-fxg/" rel="bookmark" class="crp_title">Skinning A Button in Flex 4 Using FXG</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/07/19/creating-custom-flex-4-skinnable-component/" rel="bookmark" class="crp_title">Creating Your First Custom SkinnableComponent in Flex 4</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/07/16/creating-custom-layout-in-flex-4-gumbo/" rel="bookmark" class="crp_title">Creating a Custom Layout Class in Flex 4</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/12/01/displaying-an-image-in-a-combobox/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>MigrAIRable Library Added to Google Code</title>
		<link>http://blog.smartlogicsolutions.com/2008/11/17/migrairable-library-added-to-google-code/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/11/17/migrairable-library-added-to-google-code/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 08:34:16 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=383</guid>
		<description><![CDATA[I created a Google Code repository for my winning submission to the Adobe AIR Cookbook Cook-off. The MigrAIRable library contains the source, an ANT file to create the SWC, and an example tree to demonstrate how to use it. If you haven&#8217;t read about MigrAIRable yet, it is a solution to allow your serialized data [...]]]></description>
			<content:encoded><![CDATA[<p>I created a Google Code repository for my winning submission to the Adobe AIR Cookbook Cook-off.  The <a href="http://migrairable.googlecode.com">MigrAIRable library</a> contains the source, an ANT file to create the SWC, and an example tree to demonstrate how to use it.</p>
<p>If you haven&#8217;t read about MigrAIRable yet, it is a solution to allow your serialized data structures to have migrations, so that adding new fields to later versions to your class will not break your serialization when reading older versions of the data.</p>
<p>If you&#8217;re at <a href="http://max.adobe.com">MAX</a> this week, come checkout the session <a href="http://max.adobe.com/na/sessions/browser/#839">Inside the Adobe AIR Cook-off: The Best Show Off Their Winning Chops</a> where I, along with the two runner-ups, will be panelists.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/10/29/i-won-the-air-cook-off/" rel="bookmark" class="crp_title">I Won the AIR Cook-off</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/09/11/migrating-serialization-changes-within-an-air-application/" rel="bookmark" class="crp_title">Migrating Serialization Changes Within an AIR Application</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/05/28/adobe-max-2008-registation-open/" rel="bookmark" class="crp_title">Adobe MAX 2008 Registration is Open</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/03/31/air-linux-adobe-alpha-flexbuilder/" rel="bookmark" class="crp_title">Adobe AIR Alpha Released on Linux</a></li><li><a href="http://blog.smartlogicsolutions.com/2007/08/21/adobe-onair-bus-tour-baltimore/" rel="bookmark" class="crp_title">Adobe onAIR Bus Tour: Baltimore</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/11/17/migrairable-library-added-to-google-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Presenting an Intro to Flex at Refresh Baltimore Tonight</title>
		<link>http://blog.smartlogicsolutions.com/2008/11/12/presenting-an-intro-to-flex-at-refresh-baltimore-tonight/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/11/12/presenting-an-intro-to-flex-at-refresh-baltimore-tonight/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 17:03:07 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[Presentations]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=374</guid>
		<description><![CDATA[I&#8217;ll be presenting an introduction to Flex tonight at Refresh Baltimore. If you&#8217;ve been wondering what Flex is and have been meaning to look into it, this presentation will be right up your alley. The presentation slides and code will be posted at http://www.smartlogicsolutions.com/wiki/Intro_to_Flex after the presentation. RSVP at http://www.localist.com/event/6229 if you can make it. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll be presenting an introduction to Flex tonight at <a href="http://www.refreshbmore.org">Refresh Baltimore</a>.  If you&#8217;ve been wondering what Flex is and have been meaning to look into it, this presentation will be right up your alley.</p>
<p>The presentation slides and code will be posted at <a href="http://www.smartlogicsolutions.com/wiki/Intro_to_Flex">http://www.smartlogicsolutions.com/wiki/Intro_to_Flex</a> after the presentation.</p>
<p>RSVP at <a href="http://www.localist.com/event/6229">http://www.localist.com/event/6229</a> if you can make it.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/02/06/amf-presentation-flex-blazeds-rubyamf-amfphp-coldfusion/" rel="bookmark" class="crp_title">Presentation on AMF Using BlazeDS, AMFPHP, RubyAMF, and ColdFusion</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/04/05/openflux-flex-mvc-component/" rel="bookmark" class="crp_title">Flex MVC Component Architecture Using OpenFlux</a></li><li><a href="http://blog.smartlogicsolutions.com/2007/05/20/certified-adobe-flex-2-developer/" rel="bookmark" class="crp_title">Certified Adobe Flex 2 Developer</a></li><li><a href="http://blog.smartlogicsolutions.com/2009/09/24/google-analytics-event-tracking-overview/" rel="bookmark" class="crp_title">Google Analytics Event Tracking Overview</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/10/21/advanced-css-in-flex-4-id-and-descendant-selectors/" rel="bookmark" class="crp_title">Advanced CSS in Flex 4 &#8211; ID and Descendant Selectors</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/11/12/presenting-an-intro-to-flex-at-refresh-baltimore-tonight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I Won the AIR Cook-off</title>
		<link>http://blog.smartlogicsolutions.com/2008/10/29/i-won-the-air-cook-off/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/10/29/i-won-the-air-cook-off/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 02:26:18 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[Serialization]]></category>
		<category><![CDATA[cookbook]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=354</guid>
		<description><![CDATA[I was waiting to post this until the results were announced which they were today. O&#8217;Reilly just posted the winners of the Adobe AIR Cook-off and I&#8217;m pleased to say I won the grand prize! My recipe was Migrating Serialization Changes in AIR. Thanks to anyone who voted for it. I have a follow-up recipe [...]]]></description>
			<content:encoded><![CDATA[<p>I was waiting to post this until the results were announced which they were today.  O&#8217;Reilly just <a href="http://www.insideria.com/2008/10/oreilly-contest-winners-for-ad.html">posted the winners</a> of the <a href="http://www.adobe.com/devnet/logged_in/mkoch_aircookoff.html">Adobe AIR Cook-off</a> and I&#8217;m pleased to say I won the grand prize!</p>
<p>My recipe was <a href="http://www.adobe.com/cfusion/communityengine/index.cfm?event=showDetails&#038;postId=10743&#038;productId=4&#038;loc=en_US">Migrating Serialization Changes in AIR</a>.  Thanks to anyone who voted for it.</p>
<p>I have a follow-up recipe I haven&#8217;t gotten to write up yet, but I&#8217;ll try to get it up in the next week.  It will provide a solution to add the marker which is required for this serialization to work to the front of your structures if you already have files being serialized in an existing AIR application and you want to start taking advantage of this migration technique.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/09/11/migrating-serialization-changes-within-an-air-application/" rel="bookmark" class="crp_title">Migrating Serialization Changes Within an AIR Application</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/11/17/migrairable-library-added-to-google-code/" rel="bookmark" class="crp_title">MigrAIRable Library Added to Google Code</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/03/31/air-linux-adobe-alpha-flexbuilder/" rel="bookmark" class="crp_title">Adobe AIR Alpha Released on Linux</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/02/25/flex-air-released-adobe/" rel="bookmark" class="crp_title">AIR 1.0 and Flex 3 Released</a></li><li><a href="http://blog.smartlogicsolutions.com/2007/08/21/adobe-onair-bus-tour-baltimore/" rel="bookmark" class="crp_title">Adobe onAIR Bus Tour: Baltimore</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/10/29/i-won-the-air-cook-off/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Advanced CSS in Flex 4 &#8211; ID and Descendant Selectors</title>
		<link>http://blog.smartlogicsolutions.com/2008/10/21/advanced-css-in-flex-4-id-and-descendant-selectors/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/10/21/advanced-css-in-flex-4-id-and-descendant-selectors/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 00:39:41 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=338</guid>
		<description><![CDATA[NOTE: View my comment below for updated code on making this work with the latest SDK (as of 5/25/09). A few days ago one of the commit messages in the Gumbo trunk mentioned some work for advanced CSS was beginning. I tried to create an example of using a descendant selector as well as an [...]]]></description>
			<content:encoded><![CDATA[<p><b>NOTE:</b> View <a href="http://blog.smartlogicsolutions.com/2008/10/21/advanced-css-in-flex-4-id-and-descendant-selectors/comment-page-1/#comment-2423">my comment below</a> for updated code on making this work with the latest SDK (as of 5/25/09).</p>
<p>A few days ago one of the commit messages in the <a href="http://opensource.adobe.com/svn/opensource/flex/sdk/trunk">Gumbo trunk</a> mentioned some work for advanced CSS was beginning.  I tried to create an example of using a descendant selector as well as an ID selector, but neither worked.</p>
<p>Tonight, another commit message said that this was now in place by default (I guess it would have worked earlier, but I needed to be specify a compiler argument).  But now, after rebuilding the latest checkout of <a href="http://opensource.adobe.com/wiki/display/flexsdk/Gumbo">Gumbo</a> you should now be able to compile the following example to see the advanced CSS selectors working.  Below is the SWF (you&#8217;ll need <a href="http://www.adobe.com/go/getflash">Flash Player 10</a> to view it) and the code follows:</p>
<p><span id="more-338"></span></p>
<p>[flash http://blog.smartlogicsolutions.com/wp-content/uploads/2008/10/CSSExample.swf]</p>
<h4>CSSExample.mxml</h4>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;FxApplication</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;layout<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;VerticalLayout</span> <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/layout<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Style</span> <span style="color: #000066;">source</span>=<span style="color: #ff0000;">&quot;descendants.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;VGroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TextView<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Text in a VGroup<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/TextView<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/VGroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;HGroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TextView</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;red&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Text in an HGroup<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/TextView<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/HGroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/FxApplication<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Standard so far, now let&#8217;s see the CSS with the advanced selectors:</p>
<h4>descendants.css</h4>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">VGroup TextView <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">24pt</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
HGroup TextView <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">underline</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#red</span> <span style="color: #00AA00;">&#123;</span>  
    <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ff0000</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Flex 4 is now fully demonstrating the <b>Cascading</b> part of CSS.  (You may need to review <a href="http://www.w3.org/TR/CSS21/selector.html">CSS selectors syntax</a>.)  <b>NOTE:</b> I don&#8217;t know how much of the CSS spec is going to be supported in Flex 4, and am not suggesting that everyone of the selectors at the CSS selectors page will be available in Flex 4.</p>
<p>The <code>VGroup TextView</code> selector targets any TextView instances which are a child of a VGroup.  <code>#red</code> selector targets instances with an ID of &#8220;red&#8221;.</p>
<p>As usual, here is the <a href="http://blog.smartlogicsolutions.com/wp-content/uploads/2008/10/cssexample.tgz">bundled source and SWF</a>.</p>
<p>I hope everyone’s enjoying their Gumbo!</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/10/08/new-flex-4-theme-and-class-renaming/" rel="bookmark" class="crp_title">New Flex 4 Theme and Class Renaming</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/09/25/rotate-effect-and-non-embedded-fonts-in-flex-4/" rel="bookmark" class="crp_title">Rotate Effect and Non Embedded Fonts in Flex 4</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/07/16/skinning-button-flex-4-fxg/" rel="bookmark" class="crp_title">Skinning A Button in Flex 4 Using FXG</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/05/06/flex4-opensource-gumbo-planning-documents/" rel="bookmark" class="crp_title">Flex 4 &#8220;Gumbo&#8221; Planning Documents</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/07/15/compiling-your-first-flex-4-application/" rel="bookmark" class="crp_title">Compiling Your First Flex 4 Application</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/10/21/advanced-css-in-flex-4-id-and-descendant-selectors/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

