<?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; Flex 4</title>
	<atom:link href="http://blog.smartlogicsolutions.com/tag/flex-4/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>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>
		<item>
		<title>New Flex 4 Theme and Class Renaming</title>
		<link>http://blog.smartlogicsolutions.com/2008/10/08/new-flex-4-theme-and-class-renaming/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/10/08/new-flex-4-theme-and-class-renaming/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 04:30:18 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[Spark]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=300</guid>
		<description><![CDATA[NOTE: See my comment below about updating this example until I have the chance to. A few times a day I update my subversion checkout of the Gumbo trunk. Last night I noticed a major overhaul which renamed all the Flex 4 classes, repackaged them into the mx package instead of flex. The new classes [...]]]></description>
			<content:encoded><![CDATA[<p><b>NOTE:</b> See <a href="http://blog.smartlogicsolutions.com/2008/10/08/new-flex-4-theme-and-class-renaming/comment-page-1/#comment-2424">my comment below</a> about updating this example until I have the chance to.</p>
<p>A few times a day I update my subversion checkout of the <a href="http://opensource.adobe.com/svn/opensource/flex/sdk/trunk">Gumbo trunk</a>.  Last night I noticed a major overhaul which renamed all the Flex 4 classes, repackaged them into the <code>mx</code> package instead of <code>flex</code>.  The new classes are now all (at least temporarily) prefixed with Fx, so if you are trying to compile your previously working Flex 4 code against the up-to-date SDK and suddenly see the following error:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">Error: Could not resolve <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Application<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> to a component implementation.</pre></div></div>

<p>your issue will be resolved by changing <code>Application</code> to <code>FxApplication</code>.  You&#8217;ll need to do the same for most of the other Flex 4 controls (<code>Group</code>, <code>VGroup</code>, and <code>HGroup</code> are exceptions that don&#8217;t need to be prefixed with <code>Fx</code>).</p>
<h4>Spark Theme</h4>
<p>You may also notice the new <code>spark</code> folder added in the <code>skins</code> directory.  Below is an example application showing what these new skins look like for some of the Gumbo components:<br />
<span id="more-300"></span><br />
[flash /wp-content/uploads/2008/10/spark_controls.swf]</p>
<p>As usual here is the code:</p>
<h4>FxControls.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;">&lt;FxApplication xmlns=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;">&lt;VGroup horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
        <span style="color: #000000;">&lt;FxButton label=<span style="color: #ff0000;">&quot;Button&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
        <span style="color: #000000;">&lt;FxCheckBox label=<span style="color: #ff0000;">&quot;Check Box&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
        <span style="color: #000000;">&lt;FxRadioButton label=<span style="color: #ff0000;">&quot;Radio Button&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
        <span style="color: #000000;">&lt;FxHScrollBar <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
        <span style="color: #000000;">&lt;FxNumericStepper <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
        <span style="color: #000000;">&lt;FxHSlider <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
        <span style="color: #000000;">&lt;FxTextInput <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;">&lt;/VGroup<span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;">&lt;/FxApplication<span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Remember, you&#8217;ll need <a href="http://labs.adobe.com/technologies/flashplayer10/">Flash Player 10</a> in order to run this SWF after you&#8217;ve compiled it.</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/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><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/05/06/flex4-opensource-gumbo-planning-documents/" rel="bookmark" class="crp_title">Flex 4 &#8220;Gumbo&#8221; Planning Documents</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/08/new-flex-4-theme-and-class-renaming/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Rotate Effect and Non Embedded Fonts in Flex 4</title>
		<link>http://blog.smartlogicsolutions.com/2008/09/25/rotate-effect-and-non-embedded-fonts-in-flex-4/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/09/25/rotate-effect-and-non-embedded-fonts-in-flex-4/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 03:10:55 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[effects]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=265</guid>
		<description><![CDATA[One big improvement in Flash Player 10 is that fonts no longer need to be embedded in order to rotate text or alter it&#8217;s alpha. Below is a simple example demonstrating both of these features by using the Rotate and Fade effects in Flex 4. [flash /wp-content/uploads/2008/09/rotate_and_fade.swf] Check out how simple the code is below! [...]]]></description>
			<content:encoded><![CDATA[<p>One big improvement in <a href="http://labs.adobe.com/technologies/flashplayer10/">Flash Player 10</a> is that fonts no longer need to be embedded in order to rotate text or alter it&#8217;s alpha.  Below is a simple example demonstrating both of these features by using the Rotate and Fade effects in Flex 4.</p>
<p>[flash /wp-content/uploads/2008/09/rotate_and_fade.swf]</p>
<p>Check out how simple the code is below!</p>
<p><span id="more-265"></span></p>
<h4>TestRotate.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;">&lt;Application xmlns=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;">&lt;Declarations<span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;Rotate id=<span style="color: #ff0000;">&quot;r&quot;</span> target=<span style="color: #ff0000;">&quot;{btn}&quot;</span> angleTo=<span style="color: #ff0000;">&quot;360&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;">&lt;Fade id=<span style="color: #ff0000;">&quot;a&quot;</span> target=<span style="color: #ff0000;">&quot;{btnAlpha}&quot;</span></span>
<span style="color: #000000;">              alphaFrom=<span style="color: #ff0000;">&quot;1&quot;</span> alphaTo=<span style="color: #ff0000;">&quot;0&quot;</span> duration=<span style="color: #ff0000;">&quot;3000&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;">&lt;/Declarations<span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;">&lt;VGroup horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;Button id=<span style="color: #ff0000;">&quot;btn&quot;</span> click=<span style="color: #ff0000;">&quot;r.play()&quot;</span> label=<span style="color: #ff0000;">&quot;Rotate This&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;">&lt;Button id=<span style="color: #ff0000;">&quot;btnAlpha&quot;</span> click=<span style="color: #ff0000;">&quot;a.play()&quot;</span> label=<span style="color: #ff0000;">&quot;Fade This&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;">&lt;/VGroup<span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;">&lt;/Application<span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Some changes to Gumbo since I&#8217;ve last posted:</p>
<ul>
<li>Non visual items must go in a <code>Declarations</code> block (<a href="http://opensource.adobe.com/wiki/display/flexsdk/MXML+2009#MXML2009-Nonvisualpropertydeclarationsmustgointoanew%7B%7B%3CDeclarations%3E%7D%7Dsection.Notethatvaluesforexistingpropertiesdeclaredonthebaseclasscanremaininlineaschildren.">see MXML 2009 spec</a>)</li>
<li>There are now <code>HGroup</code> and <code>VGroup</code> convenience classes so you can save some typing by not specifying the layout property</li>
</ul>
<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/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><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/08/23/recreating-ely%e2%80%99s-flex-4-list-component-series-part-3-adding-transitions/" rel="bookmark" class="crp_title">Recreating Ely’s Flex 4 List Component Series: Part 3 &#8211; Adding Transitions</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/09/25/rotate-effect-and-non-embedded-fonts-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Recreating Ely’s Flex 4 List Component Series: Part 3 &#8211; Adding Transitions</title>
		<link>http://blog.smartlogicsolutions.com/2008/08/23/recreating-ely%e2%80%99s-flex-4-list-component-series-part-3-adding-transitions/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/08/23/recreating-ely%e2%80%99s-flex-4-list-component-series-part-3-adding-transitions/#comments</comments>
		<pubDate>Sat, 23 Aug 2008 05:00:57 +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[FXG]]></category>
		<category><![CDATA[item renderer]]></category>
		<category><![CDATA[transitions]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=173</guid>
		<description><![CDATA[In Part 2 we added hovered and selected states to the ItemRenderer for the list items. In this part we&#8217;ll add some transitions to make the list look more like an Accordion. Since screenshots won&#8217;t do the example justice this time, I&#8217;ll show a screencast I made demonstrating the result first: [flash /wp-content/uploads/2008/08/elysliststep4.swf] (Sorry for [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="/2008/08/19/recreating-ely’s-flex-4-list-component-series-part-2/">Part 2</a> we added hovered and selected states to the <code>ItemRenderer</code> for the list items.  In this part we&#8217;ll add some transitions to make the list look more like an Accordion.  Since screenshots won&#8217;t do the example justice this time, I&#8217;ll show a screencast I made demonstrating the result first:</p>
<p>[flash /wp-content/uploads/2008/08/elysliststep4.swf]<br />
(Sorry for the embed being cutoff, still figuring out the params to this word press plugin.  Click through for <a href="/wp-content/uploads/2008/08/elysliststep4.swf">the full embed on its own page</a>.)</p>
<p>Keep reading for the source&#8230;</p>
<p><span id="more-173"></span></p>
<h3>Step 4: Add Accordion-like Selection Transitions</h3>
<p>I added some more data to the list so it would look more interesting than switching between only two items.  The only other thing that changed in this step was the item renderer:</p>
<h4>skins/ItemRenderer5.mxml</h4>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>ItemRenderer xmlns=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span>
              xmlns:mx=<span style="color: #ff0000;">&quot;library:adobe/flex/halo&quot;</span>
              <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;32&quot;</span> <span style="color: #0066CC;">height</span>.<span style="color: #006600;">selected</span>=<span style="color: #ff0000;">&quot;98&quot;</span><span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>states<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;normal&quot;</span> <span style="color: #66cc66;">/&gt;</span>
        <span style="color: #66cc66;">&lt;</span>State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;hovered&quot;</span> <span style="color: #66cc66;">/&gt;</span>
        <span style="color: #66cc66;">&lt;</span>State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;selected&quot;</span> <span style="color: #66cc66;">/&gt;</span>
    <span style="color: #66cc66;">&lt;/</span>states<span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>transitions<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>mx:Transition fromState=<span style="color: #ff0000;">&quot;selected&quot;</span><span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>mx:Sequence<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>mx:Parallel<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;</span>Fade <span style="color: #0066CC;">target</span>=<span style="color: #ff0000;">&quot;{details}&quot;</span> <span style="color: #66cc66;">/&gt;</span>
                <span style="color: #66cc66;">&lt;</span>Resize <span style="color: #0066CC;">target</span>=<span style="color: #ff0000;">&quot;{this}&quot;</span> <span style="color: #66cc66;">/&gt;</span>
            <span style="color: #66cc66;">&lt;/</span>mx:Parallel<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>RemoveAction <span style="color: #0066CC;">target</span>=<span style="color: #ff0000;">&quot;{details}&quot;</span> <span style="color: #66cc66;">/&gt;</span>
            <span style="color: #66cc66;">&lt;/</span>mx:Sequence<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;/</span>mx:Transition<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>mx:Transition toState=<span style="color: #ff0000;">&quot;selected&quot;</span><span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>mx:Parallel<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;</span>Fade <span style="color: #0066CC;">target</span>=<span style="color: #ff0000;">&quot;{details}&quot;</span> <span style="color: #66cc66;">/&gt;</span>
                <span style="color: #66cc66;">&lt;</span>Resize <span style="color: #0066CC;">target</span>=<span style="color: #ff0000;">&quot;{this}&quot;</span> <span style="color: #66cc66;">/&gt;</span>
            <span style="color: #66cc66;">&lt;/</span>mx:Parallel<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;/</span>mx:Transition<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;/</span>transitions<span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>content<span style="color: #66cc66;">&gt;</span>
&nbsp;
        <span style="color: #66cc66;">&lt;</span>Group <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;32&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>Rect bottom=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span> radiusX=<span style="color: #ff0000;">&quot;5&quot;</span> radiusY=<span style="color: #ff0000;">&quot;5&quot;</span><span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;</span>stroke<span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>SolidColorStroke <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;#1a2953&quot;</span> weight=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #66cc66;">/&gt;</span>
                <span style="color: #66cc66;">&lt;/</span>stroke<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;</span>fill<span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>SolidColor <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;#cccccc&quot;</span> alpha=<span style="color: #ff0000;">&quot;0&quot;</span> alpha.<span style="color: #006600;">hovered</span>=<span style="color: #ff0000;">&quot;0.5&quot;</span> <span style="color: #66cc66;">/&gt;</span>
                <span style="color: #66cc66;">&lt;/</span>fill<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;/</span>Rect<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>TextGraphic verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span>
                         fontWeight=<span style="color: #ff0000;">&quot;bold&quot;</span> fontSize=<span style="color: #ff0000;">&quot;22&quot;</span><span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">data</span>.<span style="color: #006600;">lastName</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">data</span>.<span style="color: #006600;">firstName</span><span style="color: #66cc66;">&#125;</span>
            <span style="color: #66cc66;">&lt;/</span>TextGraphic<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;/</span>Group<span style="color: #66cc66;">&gt;</span>
&nbsp;
        <span style="color: #66cc66;">&lt;</span>Group id=<span style="color: #ff0000;">&quot;details&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;36&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span>
               layout=<span style="color: #ff0000;">&quot;flex.layout.HorizontalLayout&quot;</span> includeIn=<span style="color: #ff0000;">&quot;selected&quot;</span><span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>Group <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;50&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;66&quot;</span><span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;</span>Rect bottom=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>stroke<span style="color: #66cc66;">&gt;</span>
                        <span style="color: #66cc66;">&lt;</span>SolidColorStroke <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;#ccccaa&quot;</span> weight=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #66cc66;">/&gt;</span>
                    <span style="color: #66cc66;">&lt;/</span>stroke<span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>fill<span style="color: #66cc66;">&gt;</span>
                        <span style="color: #66cc66;">&lt;</span>SolidColor <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;#ffaaaa&quot;</span> alpha=<span style="color: #ff0000;">&quot;0&quot;</span> alpha.<span style="color: #006600;">hovered</span>=<span style="color: #ff0000;">&quot;0.5&quot;</span> alpha.<span style="color: #006600;">selected</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #66cc66;">/&gt;</span>
                    <span style="color: #66cc66;">&lt;/</span>fill<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;/</span>Rect<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;/</span>Group<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>Group <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;66&quot;</span><span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;</span>Rect bottom=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>stroke<span style="color: #66cc66;">&gt;</span>
                        <span style="color: #66cc66;">&lt;</span>SolidColorStroke <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;#ccccaa&quot;</span> weight=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #66cc66;">/&gt;</span>
                    <span style="color: #66cc66;">&lt;/</span>stroke<span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>fill<span style="color: #66cc66;">&gt;</span>
                        <span style="color: #66cc66;">&lt;</span>SolidColor <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;#ffaaaa&quot;</span> alpha=<span style="color: #ff0000;">&quot;0&quot;</span> alpha.<span style="color: #006600;">hovered</span>=<span style="color: #ff0000;">&quot;0.5&quot;</span> alpha.<span style="color: #006600;">selected</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #66cc66;">/&gt;</span>
                    <span style="color: #66cc66;">&lt;/</span>fill<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;/</span>Rect<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;</span>Group verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;60&quot;</span><span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>TextGraphic top=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span> fontSize=<span style="color: #ff0000;">&quot;14&quot;</span>
                                 textAlign=<span style="color: #ff0000;">&quot;right&quot;</span> fontWeight.<span style="color: #006600;">selected</span>=<span style="color: #ff0000;">&quot;bold&quot;</span><span style="color: #66cc66;">&gt;</span>
                        phone
                    <span style="color: #66cc66;">&lt;/</span>TextGraphic<span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>TextGraphic top=<span style="color: #ff0000;">&quot;20&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span> fontSize=<span style="color: #ff0000;">&quot;14&quot;</span>
                                 textAlign=<span style="color: #ff0000;">&quot;right&quot;</span> fontWeight.<span style="color: #006600;">selected</span>=<span style="color: #ff0000;">&quot;bold&quot;</span><span style="color: #66cc66;">&gt;</span>
                        website
                    <span style="color: #66cc66;">&lt;/</span>TextGraphic<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;/</span>Group<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;</span>Line x=<span style="color: #ff0000;">&quot;64&quot;</span> yFrom=<span style="color: #ff0000;">&quot;4&quot;</span> yTo=<span style="color: #ff0000;">&quot;62&quot;</span><span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>stroke<span style="color: #66cc66;">&gt;</span>
                        <span style="color: #66cc66;">&lt;</span>SolidColorStroke <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;#ccccaa&quot;</span> weight=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #66cc66;">/&gt;</span>
                    <span style="color: #66cc66;">&lt;/</span>stroke<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;/</span>Line<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;</span>Group verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;68&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>TextGraphic fontSize=<span style="color: #ff0000;">&quot;14&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">data</span>.<span style="color: #006600;">phone</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&lt;/</span>TextGraphic<span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>TextGraphic top=<span style="color: #ff0000;">&quot;20&quot;</span> fontSize=<span style="color: #ff0000;">&quot;14&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">data</span>.<span style="color: #006600;">website</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&lt;/</span>TextGraphic<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;/</span>Group<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;/</span>Group<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;/</span>Group<span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;/</span>content<span style="color: #66cc66;">&gt;</span>
&nbsp;
<span style="color: #66cc66;">&lt;/</span>ItemRenderer<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>The keys here were to:</p>
<ul>
<li>specify a <code>height.selected</code> for the item renderer so the entire renderer would resize when the <code>details</code> Group is removed</li>
<li>use the halo <code>Transition, Sequence, and Parallel</code> classes since these alternatives aren&#8217;t present (to my knowledge yet) in Gumbo</li>
</ul>
<p>And as usual, here&#8217;s <a href='http://blog.smartlogicsolutions.com/wp-content/uploads/2008/08/elysliststep4.zip'>the source and SWF</a>.</p>
<p>I hope everyone&#8217;s enjoying their Gumbo!</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/08/19/recreating-ely%e2%80%99s-flex-4-list-component-series-part-2/" rel="bookmark" class="crp_title">Recreating Ely’s Flex 4 List Component Series: Part 2</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><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/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/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>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/08/23/recreating-ely%e2%80%99s-flex-4-list-component-series-part-3-adding-transitions/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Recreating Ely’s Flex 4 List Component Series: Part 2</title>
		<link>http://blog.smartlogicsolutions.com/2008/08/19/recreating-ely%e2%80%99s-flex-4-list-component-series-part-2/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/08/19/recreating-ely%e2%80%99s-flex-4-list-component-series-part-2/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 06:20:41 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[FXG]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[item renderer]]></category>
		<category><![CDATA[skinning]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=154</guid>
		<description><![CDATA[In Part 1 of this series we learned how to create an ItemRenderer for a List in Flex 4. I wanted to get through 2 steps tonight, but only have the code for the next step finished. This code creates the item renderer seen at ~4:20 of Ely&#8217;s video. Step 3: A More Interesting Item [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="/2008/08/16/recreating-elys-flex-4-list-component-series/">Part 1</a> of this series we learned how to create an <code>ItemRenderer</code> for a <code>List</code> in Flex 4.  I wanted to get through 2 steps tonight, but only have the code for the next step finished.  This code creates the item renderer seen at ~4:20 of <a href="http://tv.adobe.com/#v=http%3A//adobe.edgeboss.net/flash/adobe/adobetvprod/adc_presents/64_adc_018.flv%3Frss_feedid%3D1216%26xmlvers%3D2">Ely&#8217;s video</a>.</p>
<p><span id="more-154"></span></p>
<h3>Step 3: A More Interesting Item Renderer</h3>
<p>Most of the work in this step is done in the item renderer, so we&#8217;ll just blow through the Application and List skin quickly.  The only thing that has changed in the Application file is specifying the new skin and item renderer:</p>
<h4>ElysList3.mxml</h4>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>Application xmlns=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span><span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>Script<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span>       
            <span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span>
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> customers:<span style="color: #0066CC;">Array</span> = <span style="color: #66cc66;">&#91;</span>
                <span style="color: #66cc66;">&#123;</span>id: <span style="color: #cc66cc;">1</span>, firstName: <span style="color: #ff0000;">&quot;Greg&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Jastrab&quot;</span>, phone: <span style="color: #ff0000;">&quot;123-456-7890&quot;</span>, website: <span style="color: #ff0000;">&quot;http://www.smartlogicsolutions.com&quot;</span><span style="color: #66cc66;">&#125;</span>,
                <span style="color: #66cc66;">&#123;</span>id: <span style="color: #cc66cc;">2</span>, firstName: <span style="color: #ff0000;">&quot;John&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Appleseed&quot;</span>, phone: <span style="color: #ff0000;">&quot;234-567-8901&quot;</span>, website: <span style="color: #ff0000;">&quot;http://www.slsis.com&quot;</span><span style="color: #66cc66;">&#125;</span>
            <span style="color: #66cc66;">&#93;</span>;          
        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span>         
    <span style="color: #66cc66;">&lt;/</span>Script<span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>Style<span style="color: #66cc66;">&gt;</span>
        <span style="color: #0066CC;">List</span> <span style="color: #66cc66;">&#123;</span> skinZZ: ClassReference<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;skins.ListSkin3&quot;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&lt;/</span>Style<span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>List bottom=<span style="color: #ff0000;">&quot;20&quot;</span> top=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;20&quot;</span> itemRenderer=<span style="color: #ff0000;">&quot;skins.ItemRenderer3&quot;</span><span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&#123;</span>customers<span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&lt;/</span>List<span style="color: #66cc66;">&gt;</span>
&nbsp;
<span style="color: #66cc66;">&lt;/</span>Application<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>For the skin of the list I&#8217;ve only changed the border and some positioning:</p>
<h4>skins/ListSkin3.mxml</h4>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>Skin xmlns=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span><span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>Rect bottom=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span> radiusX=<span style="color: #ff0000;">&quot;5&quot;</span> radiusY=<span style="color: #ff0000;">&quot;5&quot;</span><span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>stroke<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>SolidColorStroke <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;#030303&quot;</span> weight=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #66cc66;">/&gt;</span>
        <span style="color: #66cc66;">&lt;/</span>stroke<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;/</span>Rect<span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>Group id=<span style="color: #ff0000;">&quot;contentGroup&quot;</span> bottom=<span style="color: #ff0000;">&quot;5&quot;</span> top=<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;5&quot;</span>
           layout=<span style="color: #ff0000;">&quot;flex.layout.VerticalLayout&quot;</span> <span style="color: #66cc66;">/&gt;</span>
&nbsp;
<span style="color: #66cc66;">&lt;/</span>Skin<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>Finally, we get to the meaty part&#8230;a bunch of FXG tags.  The new item renderer has the name up top, an area for an image/icon to below the name and to the left, and the phone and website to the right of the image area.  The two areas below the name will have a background color appear when the item is hovered or selected, and the phone and website labels will become bold in the selected state:</p>
<h4>skins/ItemRenderer3.mxml</h4>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>ItemRenderer xmlns=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span><span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>states<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;normal&quot;</span> <span style="color: #66cc66;">/&gt;</span>
        <span style="color: #66cc66;">&lt;</span>State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;hovered&quot;</span> <span style="color: #66cc66;">/&gt;</span>
        <span style="color: #66cc66;">&lt;</span>State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;selected&quot;</span> <span style="color: #66cc66;">/&gt;</span>
    <span style="color: #66cc66;">&lt;/</span>states<span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>content<span style="color: #66cc66;">&gt;</span>
&nbsp;
        <span style="color: #66cc66;">&lt;</span>Group <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;32&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>Rect bottom=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span> radiusX=<span style="color: #ff0000;">&quot;5&quot;</span> radiusY=<span style="color: #ff0000;">&quot;5&quot;</span><span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;</span>stroke<span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>SolidColorStroke <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;#1a2953&quot;</span> weight=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #66cc66;">/&gt;</span>
                <span style="color: #66cc66;">&lt;/</span>stroke<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;/</span>Rect<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>TextGraphic verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span>
                         fontWeight=<span style="color: #ff0000;">&quot;bold&quot;</span> fontSize=<span style="color: #ff0000;">&quot;22&quot;</span><span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">data</span>.<span style="color: #006600;">lastName</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">data</span>.<span style="color: #006600;">firstName</span><span style="color: #66cc66;">&#125;</span>
            <span style="color: #66cc66;">&lt;/</span>TextGraphic<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;/</span>Group<span style="color: #66cc66;">&gt;</span>
&nbsp;
        <span style="color: #66cc66;">&lt;</span>Group bottom=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;36&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span> layout=<span style="color: #ff0000;">&quot;flex.layout.HorizontalLayout&quot;</span><span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>Group <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;50&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;66&quot;</span><span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;</span>Rect bottom=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>stroke<span style="color: #66cc66;">&gt;</span>
                        <span style="color: #66cc66;">&lt;</span>SolidColorStroke <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;#ccccaa&quot;</span> weight=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #66cc66;">/&gt;</span>
                    <span style="color: #66cc66;">&lt;/</span>stroke<span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>fill<span style="color: #66cc66;">&gt;</span>
                        <span style="color: #66cc66;">&lt;</span>SolidColor <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;#ffaaaa&quot;</span> alpha=<span style="color: #ff0000;">&quot;0&quot;</span> alpha.<span style="color: #006600;">hovered</span>=<span style="color: #ff0000;">&quot;0.5&quot;</span> alpha.<span style="color: #006600;">selected</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #66cc66;">/&gt;</span>
                    <span style="color: #66cc66;">&lt;/</span>fill<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;/</span>Rect<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;/</span>Group<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>Group <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;66&quot;</span><span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;</span>Rect bottom=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>stroke<span style="color: #66cc66;">&gt;</span>
                        <span style="color: #66cc66;">&lt;</span>SolidColorStroke <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;#ccccaa&quot;</span> weight=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #66cc66;">/&gt;</span>
                    <span style="color: #66cc66;">&lt;/</span>stroke<span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>fill<span style="color: #66cc66;">&gt;</span>
                        <span style="color: #66cc66;">&lt;</span>SolidColor <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;#ffaaaa&quot;</span> alpha=<span style="color: #ff0000;">&quot;0&quot;</span> alpha.<span style="color: #006600;">hovered</span>=<span style="color: #ff0000;">&quot;0.5&quot;</span> alpha.<span style="color: #006600;">selected</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #66cc66;">/&gt;</span>
                    <span style="color: #66cc66;">&lt;/</span>fill<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;/</span>Rect<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;</span>Group verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;60&quot;</span><span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>TextGraphic top=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span> fontSize=<span style="color: #ff0000;">&quot;14&quot;</span>
                                 textAlign=<span style="color: #ff0000;">&quot;right&quot;</span> fontWeight.<span style="color: #006600;">selected</span>=<span style="color: #ff0000;">&quot;bold&quot;</span><span style="color: #66cc66;">&gt;</span>
                        phone
                    <span style="color: #66cc66;">&lt;/</span>TextGraphic<span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>TextGraphic top=<span style="color: #ff0000;">&quot;20&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span> fontSize=<span style="color: #ff0000;">&quot;14&quot;</span>
                                 textAlign=<span style="color: #ff0000;">&quot;right&quot;</span> fontWeight.<span style="color: #006600;">selected</span>=<span style="color: #ff0000;">&quot;bold&quot;</span><span style="color: #66cc66;">&gt;</span>
                        website
                    <span style="color: #66cc66;">&lt;/</span>TextGraphic<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;/</span>Group<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;</span>Line x=<span style="color: #ff0000;">&quot;64&quot;</span> yFrom=<span style="color: #ff0000;">&quot;4&quot;</span> yTo=<span style="color: #ff0000;">&quot;62&quot;</span><span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>stroke<span style="color: #66cc66;">&gt;</span>
                        <span style="color: #66cc66;">&lt;</span>SolidColorStroke <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;#ccccaa&quot;</span> weight=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #66cc66;">/&gt;</span>
                    <span style="color: #66cc66;">&lt;/</span>stroke<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;/</span>Line<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;</span>Group verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;68&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>TextGraphic fontSize=<span style="color: #ff0000;">&quot;14&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">data</span>.<span style="color: #006600;">phone</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&lt;/</span>TextGraphic<span style="color: #66cc66;">&gt;</span>
                    <span style="color: #66cc66;">&lt;</span>TextGraphic top=<span style="color: #ff0000;">&quot;20&quot;</span> fontSize=<span style="color: #ff0000;">&quot;14&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">data</span>.<span style="color: #006600;">website</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&lt;/</span>TextGraphic<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;/</span>Group<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;/</span>Group<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;/</span>Group<span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;/</span>content<span style="color: #66cc66;">&gt;</span>
&nbsp;
<span style="color: #66cc66;">&lt;/</span>ItemRenderer<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>And the result:<br />
<div id="attachment_158" class="wp-caption aligncenter" style="width: 510px"><img src="http://blog.smartlogicsolutions.com/wp-content/uploads/2008/08/elyslist3.png" alt="Screenshot of Ely\&#039;s List: Step 3" title="Ely\&#039;s List 3" width="500" height="402" class="size-full wp-image-158" /><p class="wp-caption-text">Screenshot of Ely's List: Step 3</p></div><br />
The next steps will be fun.  We&#8217;ll spruce up the item renderer even more, and add some animation so the list behaves more like an Accordion than a list.</p>
<p>As usual, here is the <a href='http://blog.smartlogicsolutions.com/wp-content/uploads/2008/08/elysliststep3.zip'>source and SWF</a>.</p>
<p>I hope everyone&#8217;s enjoying their Gumbo!</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/08/23/recreating-ely%e2%80%99s-flex-4-list-component-series-part-3-adding-transitions/" rel="bookmark" class="crp_title">Recreating Ely’s Flex 4 List Component Series: Part 3 &#8211; Adding Transitions</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><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/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/07/19/creating-custom-flex-4-skinnable-component/" rel="bookmark" class="crp_title">Creating Your First Custom SkinnableComponent 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/08/19/recreating-ely%e2%80%99s-flex-4-list-component-series-part-2/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Recreating Ely&#8217;s Flex 4 List Component Series</title>
		<link>http://blog.smartlogicsolutions.com/2008/08/16/recreating-elys-flex-4-list-component-series/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/08/16/recreating-elys-flex-4-list-component-series/#comments</comments>
		<pubDate>Sat, 16 Aug 2008 06:35:54 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[FXG]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[skinning]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=136</guid>
		<description><![CDATA[If you haven&#8217;t seen Ely&#8217;s video on Adobe TV about improving the designer/developer workflow (which is an updated version of what he infamously previewed at MAX last year), you should probably check that out to see what the goal of this series is. I&#8217;m going to attempt to go through the steps and recreate what [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t seen <a href="http://tv.adobe.com/#v=http%3A//adobe.edgeboss.net/flash/adobe/adobetvprod/adc_presents/64_adc_018.flv%3Frss_feedid%3D1216%26xmlvers%3D2">Ely&#8217;s video on Adobe TV</a> about improving the designer/developer workflow (which is an updated version of <a href="http://www.onflexwithcf.org/index.cfm/2007/10/19/Flex-Roadmap-presented-by-Ely-Greenfield--Videos">what he infamously previewed at MAX</a> last year), you should probably check that out to see what the goal of this series is.</p>
<p>I&#8217;m going to attempt to go through the steps and recreate what he demonstrated, which was to take a simple list and iteratively transform it into a rich, accordion-like interactive list.  To get started, be sure that you&#8217;re setup to <a href="/2008/07/15/compiling-your-first-flex-4-application/">compile Flex 4 code</a> and that you have <a href="http://labs.adobe.com/technologies/flashplayer10/">Flash Player 10</a>.  Here we go&#8230;</p>
<p><span id="more-136"></span></p>
<h3>Step 1: The Boring List</h3>
<p>We need a starting point, so first let&#8217;s get a boring old list going.</p>
<h4>ElysList.mxml</h4>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>Application xmlns=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span><span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>List <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;300&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;400&quot;</span><span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>Array<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>String<span style="color: #66cc66;">&gt;</span>something<span style="color: #66cc66;">&lt;/</span>String<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>String<span style="color: #66cc66;">&gt;</span>something else<span style="color: #66cc66;">&lt;/</span>String<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;/</span>Array<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;/</span>List<span style="color: #66cc66;">&gt;</span>
&nbsp;
<span style="color: #66cc66;">&lt;/</span>Application<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>Compile and run this, and you should see:<br />
<div id="attachment_137" class="wp-caption aligncenter" style="width: 510px"><img src="http://blog.smartlogicsolutions.com/wp-content/uploads/2008/08/elyslist1.png" alt="Screenshot of Ely\&#039;s List: Step 1" title="Ely\&#039;s List 1" width="500" height="432" class="size-full wp-image-137" /><p class="wp-caption-text">Screenshot of Ely's List: Step 1</p></div></p>
<p>Looks marvelous, doesn&#8217;t it?  Let&#8217;s go for step 2, which is to add a border and to make the data in the list some objects rather than just an array of strings.</p>
<h3>Step 2: List Using Objects for Data and Adding a Border</h3>
<p>The application file for step 2 is still kinda boring.  Here we&#8217;ll just make a bindable array of object data and specify a skin file for the List, as well as an item renderer the items in the list should use.</p>
<h4>ElysList2.mxml</h4>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>Application xmlns=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span><span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>Script<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span>
            <span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span> <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> customers:<span style="color: #0066CC;">Array</span> = <span style="color: #66cc66;">&#91;</span>
                <span style="color: #66cc66;">&#123;</span>id: <span style="color: #cc66cc;">1</span>, firstName: <span style="color: #ff0000;">&quot;Greg&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Jastrab&quot;</span>, phone: <span style="color: #ff0000;">&quot;123-456-7890&quot;</span>, website: <span style="color: #ff0000;">&quot;http://www.smartlogicsolutions.com&quot;</span><span style="color: #66cc66;">&#125;</span>,
                <span style="color: #66cc66;">&#123;</span>id: <span style="color: #cc66cc;">2</span>, firstName: <span style="color: #ff0000;">&quot;John&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Appleseed&quot;</span>, phone: <span style="color: #ff0000;">&quot;234-567-8901&quot;</span>, website: <span style="color: #ff0000;">&quot;http://www.slsis.com&quot;</span><span style="color: #66cc66;">&#125;</span>
            <span style="color: #66cc66;">&#93;</span>;
        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;/</span>Script<span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>Style<span style="color: #66cc66;">&gt;</span>
        <span style="color: #0066CC;">List</span> <span style="color: #66cc66;">&#123;</span> skinZZ: ClassReference<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;skins.ListSkin2&quot;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&lt;/</span>Style<span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>List bottom=<span style="color: #ff0000;">&quot;20&quot;</span> top=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;20&quot;</span> itemRenderer=<span style="color: #ff0000;">&quot;skins.ItemRenderer2&quot;</span><span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&#123;</span>customers<span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&lt;/</span>List<span style="color: #66cc66;">&gt;</span>
&nbsp;
<span style="color: #66cc66;">&lt;/</span>Application<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>Let&#8217;s checkout the skin for the List:</p>
<h4>skins/ListSkin2.mxml</h4>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>Skin xmlns=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span><span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>Rect bottom=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span> radiusX=<span style="color: #ff0000;">&quot;8&quot;</span> radiusY=<span style="color: #ff0000;">&quot;8&quot;</span><span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>stroke<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>SolidColorStroke <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;#ccccaa&quot;</span> weight=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #66cc66;">/&gt;</span>
        <span style="color: #66cc66;">&lt;/</span>stroke<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;/</span>Rect<span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>Group id=<span style="color: #ff0000;">&quot;contentGroup&quot;</span> bottom=<span style="color: #ff0000;">&quot;5&quot;</span> top=<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;10&quot;</span>
           layout=<span style="color: #ff0000;">&quot;flex.layout.VerticalLayout&quot;</span> <span style="color: #66cc66;">/&gt;</span>
&nbsp;
<span style="color: #66cc66;">&lt;/</span>Skin<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>Here we use some new FXG tags to draw the border around the list, and then place the container which will hold the elements of the list within that border.</p>
<p><b>IMPORTANT:</b> The ID of the group is not arbitrary.  If you look inside the <a href="http://opensource.adobe.com/svn/opensource/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/ItemsComponent.as">flex.component.ItemsComponent class</a> (which List is a descendant of) you will find a SkinPart being declared for the contentGroup variable that is typed as Group:</p>

<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> contentGroup:Group;</pre></div></div>

<p>This means the skin file must include a <code>Group</code> with an ID of <code>contentGroup</code> where the item renderers within the list will be placed.  Speaking of item renderers, that brings us to the last piece of step 2.</p>
<h4>skins/ItemRenderer2.mxml</h4>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>ItemRenderer xmlns=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span><span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>states<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;normal&quot;</span> <span style="color: #66cc66;">/&gt;</span>
        <span style="color: #66cc66;">&lt;</span>State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;hovered&quot;</span> <span style="color: #66cc66;">/&gt;</span>
        <span style="color: #66cc66;">&lt;</span>State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;selected&quot;</span> <span style="color: #66cc66;">/&gt;</span>
    <span style="color: #66cc66;">&lt;/</span>states<span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>content<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>Rect bottom=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>fill<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;</span>SolidColor <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;#0000ff&quot;</span> alpha=<span style="color: #ff0000;">&quot;0&quot;</span> alpha.<span style="color: #006600;">hovered</span>=<span style="color: #ff0000;">&quot;0.2&quot;</span> alpha.<span style="color: #006600;">selected</span>=<span style="color: #ff0000;">&quot;0.8&quot;</span> <span style="color: #66cc66;">/&gt;</span>
            <span style="color: #66cc66;">&lt;/</span>fill<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;/</span>Rect<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>Group id=<span style="color: #ff0000;">&quot;contentHolder&quot;</span> bottom=<span style="color: #ff0000;">&quot;3&quot;</span> top=<span style="color: #ff0000;">&quot;3&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span>
               layout=<span style="color: #ff0000;">&quot;flex.layout.HorizontalLayout&quot;</span><span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>TextGraphic fontSize=<span style="color: #ff0000;">&quot;20&quot;</span> fontWeight=<span style="color: #ff0000;">&quot;bold&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">data</span>.<span style="color: #006600;">lastName</span><span style="color: #66cc66;">&#125;</span>,<span style="color: #66cc66;">&lt;/</span>TextGraphic<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>TextGraphic fontSize=<span style="color: #ff0000;">&quot;20&quot;</span> fontWeight=<span style="color: #ff0000;">&quot;bold&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">data</span>.<span style="color: #006600;">firstName</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&lt;/</span>TextGraphic<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;/</span>Group<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;/</span>content<span style="color: #66cc66;">&gt;</span>
&nbsp;
<span style="color: #66cc66;">&lt;/</span>ItemRenderer<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>Here we have specified an ItemRenderer with 3 states (normal/hovered/selected).  We&#8217;ve added a solid background which will change its alpha value depending on the view state.  And finally we added 2 pieces of text so we will see &#8220;Lastname, Firstname&#8221; in the list.</p>
<p>Compile ElysList2.mxml and you should see:<br />
<div id="attachment_143" class="wp-caption aligncenter" style="width: 510px"><img src="http://blog.smartlogicsolutions.com/wp-content/uploads/2008/08/elyslist2.png" alt="Screenshot of Ely\&#039;s List: Step 2" title="Ely\&#039;s List 2" width="500" height="398" class="size-full wp-image-143" /><p class="wp-caption-text">Screenshot of Ely's List: Step 2</p></div></p>
<p>Later this week I&#8217;ll tackle the next steps, but hopefully this will keep some of you busy over the weekend.:)</p>
<p>Oh, and here is the source so you won&#8217;t have to retype all of the above: <a href='http://blog.smartlogicsolutions.com/wp-content/uploads/2008/08/elysliststeps1-2.zip'>Ely\&#8217;s List Steps 1-2</a></p>
<p>Enjoy your Gumbo!</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/08/19/recreating-ely%e2%80%99s-flex-4-list-component-series-part-2/" rel="bookmark" class="crp_title">Recreating Ely’s Flex 4 List Component Series: Part 2</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/08/23/recreating-ely%e2%80%99s-flex-4-list-component-series-part-3-adding-transitions/" rel="bookmark" class="crp_title">Recreating Ely’s Flex 4 List Component Series: Part 3 &#8211; Adding Transitions</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/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/07/19/creating-custom-flex-4-skinnable-component/" rel="bookmark" class="crp_title">Creating Your First Custom SkinnableComponent 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/08/16/recreating-elys-flex-4-list-component-series/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

