<?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; FXG</title>
	<atom:link href="http://blog.smartlogicsolutions.com/category/fxg/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>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>
		<item>
		<title>Skinning A Button in Flex 4 Using FXG</title>
		<link>http://blog.smartlogicsolutions.com/2008/07/16/skinning-button-flex-4-fxg/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/07/16/skinning-button-flex-4-fxg/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 06:01:36 +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>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2008/07/16/skinning-button-flex-4-fxg/</guid>
		<description><![CDATA[In yesterday&#8217;s post I walked through how I got the Flex 4 SDK setup, compiled, and ran the first Hello World application in Flex 4. I said I would follow up today with skinning a Button using the new declarative graphics tags known as FXG (previously referred to as MXML-G), so here we are. Today [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://blog.smartlogicsolutions.com/2008/07/15/compiling-your-first-flex-4-application">yesterday&#8217;s post</a> I walked through how I got the Flex 4 SDK setup, compiled, and ran the first Hello World application in Flex 4.  I said I would follow up today with skinning a Button using the new declarative graphics tags known as FXG (previously referred to as MXML-G), so here we are.</p>
<p>Today I want to explore using the new layout property as well as using a <a href="http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Component+Architecture#GumboComponentArchitecture-NewComponentLifecycle">Skin file</a> to describe how the button should look.  Let&#8217;s get started&#8230;</p>
<p><span id="more-63"></span></p>
<p>This project will have 3 files:</p>
<ol>
<li><b>NewSkinning.mxml</b> &#8211; main application containing 2 buttons</li>
<li><b>MyButtonSkin.mxml</b> &#8211; first custom button skin</li>
<li><b>OtherSkin.mxml</b> &#8211; circular button skin</li>
</ol>
<h4>NewSkinning.mxml</h4>
<p><b>UPDATE:</b> Removed <code>xmlns:mx="library:adobe/flex/halo"</code> and changed <code>&lt;mx:Style&gt;</code> to <code>&lt;Style&gt;</code> as <a href="#comment-108">pointed out</a> by Peter.</p>

<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>
             layout=<span style="color: #ff0000;">&quot;flex.layout.VerticalLayout&quot;</span>
             <span style="color: #0066CC;">backgroundColor</span>=<span style="color: #ff0000;">&quot;gray&quot;</span><span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>Style<span style="color: #66cc66;">&gt;</span>
        <span style="color: #0066CC;">Button</span> <span style="color: #66cc66;">&#123;</span> skinZZ: ClassReference<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;MyButtonSkin&quot;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span>
        .<span style="color: #006600;">otherButton</span> <span style="color: #66cc66;">&#123;</span> skinZZ: ClassReference<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;OtherSkin&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>Button label=<span style="color: #ff0000;">&quot;Hello World&quot;</span> <span style="color: #66cc66;">/&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>Button styleName=<span style="color: #ff0000;">&quot;otherButton&quot;</span> label=<span style="color: #ff0000;">&quot;Hello World 2&quot;</span> <span style="color: #66cc66;">/&gt;</span>
&nbsp;
<span style="color: #66cc66;">&lt;/</span>Application<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>Two things to note here are that you cannot include two language namespaces in the same file.  If you replace &#8220;library:adobe/flex/halo&#8221; with &#8220;http://www.adobe.com/2006/mxml&#8221; you will get an error when trying to compile the application:</p>
<pre>/Developer/Applications/Flex/test4/new_skinning/NewSkinning.mxml(5): col: 28
Error: Only one language namespace must be specified per document.
Found 'http://ns.adobe.com/mxml/2009' and 'http://www.adobe.com/2006/mxml'.</pre>
<p><b>UPDATE:</b> You can ignore this if you&#8217;re using the updated code, but I&#8217;ll leave this in here in case people search for the compiler error above.</p>
<p>Secondly, you&#8217;ll notice a new attribute from my code from yesterday: <code>layout</code>, which is assigned a new class value.  <a href="http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Layout">Layout in Flex 4</a> can be handled separately from the view if you don&#8217;t want to use absolute positioning.  The <code>layout="flex.layout.VerticalLayout"</code> will tell the Application to use the <code>flex.layout.VerticalLayout</code> class to layout the children.</p>
<p>At first, this may not seem like a big deal, since you could define vertical or horizontal layout in an Application in Flex 3, but this now carries through to all classes, and it is easy to simply write a new layout class and assign that to the <code>layout</code> property if you want to write some custom layout code yourself.  Notice the <code>skinZZ</code> property in the CSS is used to assign the view class for the Button components.  Now let&#8217;s check out the Skin files.</p>
<h4>MyButtonSkin.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>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;up&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;over&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;down&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;disabled&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>Rect <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> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span> minWidth=<span style="color: #ff0000;">&quot;100&quot;</span> minHeight=<span style="color: #ff0000;">&quot;40&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;0x020202&quot;</span> <span style="color: #0066CC;">color</span>.<span style="color: #006600;">over</span>=<span style="color: #ff0000;">&quot;0xFF00FF&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;white&quot;</span> <span style="color: #0066CC;">color</span>.<span style="color: #006600;">over</span>=<span style="color: #ff0000;">&quot;gray&quot;</span> <span style="color: #0066CC;">color</span>.<span style="color: #0066CC;">down</span>=<span style="color: #ff0000;">&quot;0xFF0562&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>
&nbsp;
        <span style="color: #66cc66;">&lt;</span>TextBox <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;{data.label}&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;Arial&quot;</span> fontSize=<span style="color: #ff0000;">&quot;12&quot;</span>
                 <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;0xFF0000&quot;</span> <span style="color: #0066CC;">color</span>.<span style="color: #006600;">disabled</span>=<span style="color: #ff0000;">&quot;0xC0C0C0&quot;</span>
                 <span style="color: #0066CC;">color</span>.<span style="color: #006600;">over</span>=<span style="color: #ff0000;">&quot;0x0000FF&quot;</span> <span style="color: #0066CC;">color</span>.<span style="color: #0066CC;">down</span>=<span style="color: #ff0000;">&quot;0x00FF00&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> top=<span style="color: #ff0000;">&quot;4&quot;</span> bottom=<span style="color: #ff0000;">&quot;2&quot;</span>
                 textAlign=<span style="color: #ff0000;">&quot;center&quot;</span> verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span> <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>Skin<span style="color: #66cc66;">&gt;</span></pre></div></div>

<h4>OtherSkin.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>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;up&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;over&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;down&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;disabled&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>Ellipse <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;30&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;blue&quot;</span> <span style="color: #0066CC;">color</span>.<span style="color: #006600;">over</span>=<span style="color: #ff0000;">&quot;red&quot;</span> <span style="color: #0066CC;">color</span>.<span style="color: #0066CC;">down</span>=<span style="color: #ff0000;">&quot;white&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>Ellipse<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>Skin<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>Compile and run the app and you should see:<br />
<div id="attachment_90" class="wp-caption aligncenter" style="width: 510px"><img src="http://blog.smartlogicsolutions.com/wp-content/uploads/2008/07/newskinning.png" alt="NewSkinning Screenshot" title="newskinning" width="500" height="406" class="size-full wp-image-90" /><p class="wp-caption-text">NewSkinning Screenshot</p></div></p>
<p><b>NOTE:</b> If you are on Windows and having problems compiling, look <a href="http://blog.smartlogicsolutions.com/2008/07/15/compiling-your-first-flex-4-application/#comment-106">at the comment</a> that <a href="http://sherifabdou.com/">Sherif</a> left in my previous post.</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/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/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/19/creating-custom-flex-4-skinnable-component/" rel="bookmark" class="crp_title">Creating Your First Custom SkinnableComponent in Flex 4</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/07/16/creating-custom-layout-in-flex-4-gumbo/" rel="bookmark" class="crp_title">Creating a Custom Layout Class in Flex 4</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/07/16/skinning-button-flex-4-fxg/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Compiling Your First Flex 4 Application</title>
		<link>http://blog.smartlogicsolutions.com/2008/07/15/compiling-your-first-flex-4-application/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/07/15/compiling-your-first-flex-4-application/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 07:57:09 +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>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2008/07/15/compiling-your-first-flex-4-application/</guid>
		<description><![CDATA[Big news today in the world of Flex! The first push of the Flex 4 source was made this afternoon (and another push was made this evening). Additionally, a lot of documentation was added to the Adobe Open Source site regarding Flex 4 (code-named &#8220;Gumbo&#8221;). Reading through the Architecture Whitepaper will leave you with a [...]]]></description>
			<content:encoded><![CDATA[<p>Big news today in the world of Flex!  The first push of the <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4">Flex 4 source</a> was made this afternoon (and another push was made this evening).  Additionally, a lot of <a href="http://opensource.adobe.com/wiki/display/flexsdk/Developer+Documentation">documentation</a> was added to the Adobe Open Source site regarding <a href="http://opensource.adobe.com/wiki/display/flexsdk/Gumbo">Flex 4</a> (code-named &#8220;Gumbo&#8221;).  Reading through the <a href="http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Component+Architecture">Architecture Whitepaper</a> will leave you with a great handle around where things stand and the current direction Flex is headed.</p>
<p>To reward myself for reading through all of those docs this evening, I decided it would be appropriate to try to test out the new code and make my first Flex 4 application&#8230;</p>
<p><span id="more-60"></span></p>
<h3>Step 1: Get the Latest SDK</h3>
<p>First we&#8217;ll need to get the latest SDK.  You can either download the SDK under the &#8220;Adobe Flex SDK&#8221; column on the download page listed above, or checkout the source yourself:</p>
<pre>svn checkout http://opensource.adobe.com/svn/opensource/flex/sdk/trunk</pre>
<p>I&#8217;ll refer to the location you&#8217;ve put the SDK to on your disk as <code>${FLEX4}</code> throughout the rest of this post.</p>
<p>Follow the instructions on the <a href="http://opensource.adobe.com/wiki/display/flexsdk/Setup">Setup</a> (links to Windows/Mac/Linux pages are at the bottom) and <a href="http://opensource.adobe.com/wiki/display/flexsdk/Build+and+Test">Build and Test</a> pages to ensure the compiler is working on your system.</p>
<p>Assuming everything compiled and ran correctly when you did the
<pre>ant -q checkintests</pre>
<p> command, you&#8217;re ready for the next step.</p>
<h3>Step 2: Flex 4 &#8211; First App</h3>
<p>Now that the SDK is setup, we&#8217;re ready to make our first Flex 4 application.  First, I wanted to check out the new <a href="http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Component+Architecture#GumboComponentArchitecture-GraphicsinMXML">FXG</a> tags, so let&#8217;s get a simple rectangle working first (this will look familiar if you&#8217;ve been playing with <a href="http://www.degrafa.com">Degrafa</a>):</p>
<p><code>Flex4App.mxml</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>Application xmlns=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span>
             <span style="color: #0066CC;">backgroundColor</span>=<span style="color: #ff0000;">&quot;red&quot;</span><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>Rect <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;20&quot;</span> top=<span style="color: #ff0000;">&quot;20&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;100&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;0x00FF00&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;0x09BDFC&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>Application<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>Assuming you&#8217;re in the current directory that <code>Flex4App.mxml</code> is sitting in:</p>
<p>Run: <code>${FLEX4}/bin/mxmlc Flex4App.mxml</code></p>
<p>This should compile your code and if successful will create a <code>Flex4App.swf</code> file.  To run it using the Flash Player 10 (since Flex 4 targets this player):</p>
<p>Run (if you&#8217;re on Mac): <code>${FLEX4}/in/player/mac/Flash Player.app/Contents/MacOS/Flash Player Flex4App.swf</code></p>
<p>If you&#8217;re on Windows or Linux, look in the <code>${FLEX4}/build.xml</code> ANT script at lines 26 and 34 to see the path to the 10 player on those systems.</p>
<p>Assuming all went well you should see something like:<br />
<div id="attachment_95" class="wp-caption aligncenter" style="width: 510px"><img src="http://blog.smartlogicsolutions.com/wp-content/uploads/2008/07/flex4app.png" alt="Flex4App Screenshot" title="flex4app" width="500" height="411" class="size-full wp-image-95" /><p class="wp-caption-text">Flex4App Screenshot</p></div></p>
<h3>Step 3: Flex 4 &#8211; Hello World!</h3>
<p>For our final step, let&#8217;s throw in a button saying &#8220;Hello World&#8221;.</p>
<p><code>HelloWorld.mxml</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>Application xmlns=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span>
             <span style="color: #0066CC;">backgroundColor</span>=<span style="color: #ff0000;">&quot;red&quot;</span><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>Rect <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;20&quot;</span> top=<span style="color: #ff0000;">&quot;20&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;100&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;0x00FF00&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;0x09BDFC&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>
&nbsp;
  <span style="color: #66cc66;">&lt;</span>Button <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;20&quot;</span> bottom=<span style="color: #ff0000;">&quot;5&quot;</span> label=<span style="color: #ff0000;">&quot;Hello World&quot;</span> <span style="color: #66cc66;">/&gt;</span>
<span style="color: #66cc66;">&lt;/</span>Application<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>Compile and run those&#8230;</p>
<p><code>${FLEX4}/bin/mxmlc HelloWorld.mxml</code><br />
<code>${FLEX4}/in/player/mac/Flash Player.app/Contents/MacOS/Flash Player HelloWorld.swf</code></p>
<p>and you should see</p>
<div id="attachment_97" class="wp-caption aligncenter" style="width: 510px"><a href="http://blog.smartlogicsolutions.com/wp-content/uploads/2008/07/flex4helloworld.png"><img src="http://blog.smartlogicsolutions.com/wp-content/uploads/2008/07/flex4helloworld.png" alt="HelloWorld Screenshot" title="flex4helloworld" width="500" height="403" class="size-full wp-image-97" /></a><p class="wp-caption-text">HelloWorld Screenshot</p></div>
<h3>More Fun To Come&#8230;</h3>
<p>Tomorrow or the next day I&#8217;ll try to play around with skinning a Button using a Skin file and get another post up regarding it.  Happy Flex 4&#8242;ing!</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/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/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/05/16/flash-player-10-astro-flex-sdk-compile/" rel="bookmark" class="crp_title">Flash Player 10 (&#8220;Astro&#8221;) Prerelease and Flex SDK Build Available to Compile Flash Player 10 Content</a></li><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>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/07/15/compiling-your-first-flex-4-application/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

