<?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>rabidGadfly &#187; Flex</title>
	<atom:link href="http://rabidgadfly.com/category/flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://rabidgadfly.com</link>
	<description>Simple Solutions to Nagging Coding Problems</description>
	<lastBuildDate>Wed, 19 Oct 2011 13:43:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Flex Optimization Tip: Evaluate Your Setter Parameter</title>
		<link>http://rabidgadfly.com/2011/03/flex-optimization-tip-evaluate-your-setter-parameter/</link>
		<comments>http://rabidgadfly.com/2011/03/flex-optimization-tip-evaluate-your-setter-parameter/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 18:37:39 +0000</pubDate>
		<dc:creator>rabidgadfly</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[flash builder]]></category>
		<category><![CDATA[getter]]></category>
		<category><![CDATA[setter]]></category>

		<guid isPermaLink="false">http://rabidgadfly.com/?p=529</guid>
		<description><![CDATA[Flash Builder makes it easy to generate getters and setters from a variable definition. Just select the variable, right-click and choose Source > Generate getters/setters. The generated code is simple; the getter returns the value and the setter sets the value: Oftentimes in Flex, however, changing a variable is a trigger that causes other code [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://rabidgadfly.com/2011/03/flex-optimization-tip-evaluate-your-setter-parameter/fb5/" rel="attachment wp-att-534"><img src="http://rabidgadfly.com/wp-content/uploads/2011/03/fb5.png" alt="" title="fb5" width="150" height="150" class="alignright size-full wp-image-534" /></a>Flash Builder makes it easy to generate getters and setters from a variable definition. Just select the variable, right-click and choose Source > Generate getters/setters.</p>
<p>The generated code is simple; the getter returns the value and the setter sets the value:</p>
<pre class="brush: as3; title: ; notranslate">
private var _myData:String;

public function get myData():String {
    return _myData;
}

public function set myData(value:String):void {
   _myData = value;
}
</pre>
<p>Oftentimes in Flex, however, changing a variable is a trigger that causes other code to run or update. But  why would you want this extra processing to occur if the value that is being assigned hasn&#8217;t changed?<br />
<span id="more-529"></span><br />
Instead, add a quick comparison:</p>
<pre class="brush: as3; title: ; notranslate">
public function set myData(value:String):void {
    if(_myData != value) {
       _myData = value;
    }
}
</pre>
<p>Note that you would use ObjectUtil.compare rather than equality to compare complex Objects: </p>
<pre class="brush: as3; title: ; notranslate">
public function set myObjectData(value:Object):void {
    if(ObjectUtil.compare(_myObjectData,value) != 0 ) {
       _myObjectData = value;
    }
}
</pre>
<p>Obviously, depending on the complexity and size of the objects, and the amount of work to be done after an update, comparing Objects may not make sense in all circumstances. That&#8217;s a judgement call you can make based on your particular code.</p>
]]></content:encoded>
			<wfw:commentRss>http://rabidgadfly.com/2011/03/flex-optimization-tip-evaluate-your-setter-parameter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Swiz &#8216;Could not get a reference to class&#8217; Gotcha</title>
		<link>http://rabidgadfly.com/2011/02/swiz-could-not-get-a-reference-to-class-gotcha/</link>
		<comments>http://rabidgadfly.com/2011/02/swiz-could-not-get-a-reference-to-class-gotcha/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 14:56:03 +0000</pubDate>
		<dc:creator>rabidgadfly</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[swiz]]></category>

		<guid isPermaLink="false">http://rabidgadfly.com/?p=500</guid>
		<description><![CDATA[I&#8217;ve been implementing Swiz framework in my most recent Flex project. It&#8217;s worked great so far, but this one error sidetracked me for an hour or so: "Could not get a reference to class for YourEvent.YOUR_EVENT_TYPE. Did you specify its package in SwizConfig::eventPackages?" Obviously, the first thing to do when receiving this message is to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://rabidgadfly.com/2011/02/swiz-could-not-get-a-reference-to-class-gotcha/projectavatar/" rel="attachment wp-att-501"><img src="http://rabidgadfly.com/wp-content/uploads/2011/02/projectavatar.png" alt="" title="projectavatar" width="75" height="75" class="alignright size-full wp-image-501" /></a>I&#8217;ve been implementing <a href="http://swizframework.org/">Swiz framework</a> in my most recent <a href="http://www.adobe.com/products/flex/">Flex</a> project. It&#8217;s worked great so far, but this one error sidetracked me for an hour or so:</p>
<p><code>"Could not get a reference to class for <em>YourEvent.YOUR_EVENT_TYPE</em>. Did you specify its package in SwizConfig::eventPackages?"</code></p>
<p><span id="more-500"></span><br />
Obviously, the first thing to do when receiving this message is to make sure you specified the event package in SwizConfig::eventPackages. Once that&#8217;s confirmed, you ensure that the event has been imported, then try cleaning your project(s). </p>
<p>At this point it starts getting frustrating and you could easily start going off the rails moving code around and making crazy modifications. Before you get to that point, make sure you&#8217;re actually dispatching the event somewhere in your code. If you aren&#8217;t, then the event isn&#8217;t included when the application is compiled. Since it never gets included, Swiz cannot get a reference to it when the application runs.</p>
<p>This can happen when refactoring and moving events around a little at a time. If you&#8217;re like me, you do a little testing along the way to make sure everything continues to work properly. That&#8217;s when you can wind up in a case where you may be listening for an event that you haven&#8217;t yet written the dispatch code for.</p>
<p>It may seems like an occurrence that may happen once in a blue moon (Mmmm&#8230;<a href="http://www.bluemoonbrewingcompany.com/">Blue Moon</a>), but it&#8217;s already happened to me twice in the span of a couple of weeks.</p>
]]></content:encoded>
			<wfw:commentRss>http://rabidgadfly.com/2011/02/swiz-could-not-get-a-reference-to-class-gotcha/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Unusual Flex Problem? Check Your Metadata!</title>
		<link>http://rabidgadfly.com/2011/02/unusual-flex-problem-check-your-metadata/</link>
		<comments>http://rabidgadfly.com/2011/02/unusual-flex-problem-check-your-metadata/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 18:46:31 +0000</pubDate>
		<dc:creator>rabidgadfly</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flash builder]]></category>
		<category><![CDATA[metadata]]></category>

		<guid isPermaLink="false">http://rabidgadfly.com/?p=469</guid>
		<description><![CDATA[I&#8217;ve been working with Flash Builder 4 every day for about six months now, and I love it. Overall, Flash Builder is a great programming environment offering helpful debugging tools, plenty of useful keyboard shortcuts, code-hinting and completion, and error feedback on compilation issues. The compilation errors can be SO helpful that you rely on [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-476" href="http://rabidgadfly.com/2011/02/unusual-flex-problem-check-your-metadata/angry_2x2/"><img class="alignright size-full wp-image-476" title="Stressed" src="http://rabidgadfly.com/wp-content/uploads/2011/02/angry_2x2.jpg" alt="" width="200" height="200" /></a>I&#8217;ve been working with Flash Builder 4 every day for about six months now, and I love it. Overall, Flash Builder is a great programming environment offering helpful debugging tools, plenty of useful keyboard shortcuts, code-hinting and completion, and error feedback on compilation issues.</p>
<p>The compilation errors can be SO helpful that you rely on them as guides. When refactoring code the errors tell you where you need to go to fix affected code. And if you use metadata correctly, the errors can tell you when you&#8217;ve forgotten to include a required component.</p>
<p>As helpful as the metadata, code-hinting and error-checking is, it&#8217;s not quite perfect; and it&#8217;s these little imperfections that can set you off on an afternoon-long detour. Reason being, while metadata can help enforce rules and enhance code-hinting, and while error-checking can point out problems with your code, metadata itself is not error-checked.</p>
<p>Enter my problem&#8230;</p>
<p><span id="more-469"></span>I added a skin state and skin parts to an existing component and couldn&#8217;t for the life of me figure out why the component class would not update the content of the text fields I had placed in the skin. I&#8217;d done this several times before but this time it just wouldn&#8217;t work.</p>
<p>I made sure I had defined the skin parts in my component, I traced and debugged for several hours, I googled  and traversed several blogs, I read through the Adobe online help reading in-depth descriptions of getCurrentSkinState, invalidateSkinState, and attachSkin.</p>
<p>Finally, it dawned on me. I scrolled once again up to the section of my component where I defined the skin parts and looked closely at the meta data definition. Sure enough, there was the problem.  I had type &#8220;Skinpart&#8221; instead of &#8220;SkinPart&#8221;. I forgot to capitalize the P. No warnings, no errors; just a bunch of text fields in the skin and variables in the component that were acting appropriately on their own, but were not connected in any way.</p>
<p>It took about a half hour to remove all of the ridiculous code I had added to try to compensate for that lowercase p. In the end, I walk away with a better knowledge of Flex skins, and hopefully an ability to recognize that issue sooner in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://rabidgadfly.com/2011/02/unusual-flex-problem-check-your-metadata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Flex Arrow Buttons Using Spark Path</title>
		<link>http://rabidgadfly.com/2010/11/create-flex-arrow-buttons-using-spark-path/</link>
		<comments>http://rabidgadfly.com/2010/11/create-flex-arrow-buttons-using-spark-path/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 02:33:40 +0000</pubDate>
		<dc:creator>rabidgadfly</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.rabidgadfly.com/?p=449</guid>
		<description><![CDATA[Path is a Flex 4 drawing class that fills a shape using coordinates you provide. It&#8217;s very simple once you get the hang of it, and if you add some filters you can come up with a pretty nice looking image. In this post I&#8217;m going to show you a quick overview of how to [...]]]></description>
			<content:encoded><![CDATA[<p>Path is a Flex 4 drawing class that fills a shape using coordinates you provide. It&#8217;s very simple once you get the hang of it, and if you add some filters you can come up with a pretty nice looking image. In this post I&#8217;m going to show you a quick overview of how to draw a custom arrow using Path that can be used as a button as seen in this sample:</p>
<div width="100%" style="text-align:center;">

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_pathButtons_1440940332"
			class="flashmovie"
			width="200"
			height="150">
	<param name="movie" value="http://www.rabidgadfly.com/swf/pathButtons/pathButtons.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.rabidgadfly.com/swf/pathButtons/pathButtons.swf"
			name="fm_pathButtons_1440940332"
			width="200"
			height="150">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
</div>
<p><span id="more-449"></span><br />
You can right-click the sample to view or download the source.</p>
<p>After creating a new Flex 4 Web Application project, I create a new MXML skin named NextButtonSkin based on spark.components.Button. While my button will use the states and functionality of a Spark button, it will use none of the look so I delete most of the default Button MXML. ( If you want more detail on button skinning you can take a look at my <a href="http://www.rabidgadfly.com/index.php/2010/09/30/easily-create-image-buttons-flex-4/">Create Your Own Image Buttons</a> post. ) The remaining button skin code looks like this:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;

&lt;s:SparkSkin xmlns:fx=&quot;http://ns.adobe.com/mxml/2009&quot;
			 xmlns:s=&quot;library://ns.adobe.com/flex/spark&quot;
			 xmlns:fb=&quot;http://ns.adobe.com/flashbuilder/2009&quot;
			 minWidth=&quot;48&quot; minHeight=&quot;48&quot;
			 alpha.disabled=&quot;0.5&quot;&gt;

	&lt;!-- host component --&gt;
	&lt;fx:Metadata&gt;
		&lt;![CDATA[
		/* @copy spark.skins.spark.ApplicationSkin#hostComponent 	*/
		[HostComponent(&quot;spark.components.Button&quot;)]
		]]&gt;
	&lt;/fx:Metadata&gt;

	&lt;!-- states --&gt;
	&lt;s:states&gt;
		&lt;s:State name=&quot;up&quot; /&gt;
		&lt;s:State name=&quot;over&quot; /&gt;
		&lt;s:State name=&quot;down&quot; /&gt;
		&lt;s:State name=&quot;disabled&quot; /&gt;
	&lt;/s:states&gt;

	&lt;!--- Your arrow will start after this line ---&gt;

	&lt;!---- Your arrow will end above this line -----&gt;

&lt;/s:SparkSkin&gt;
</pre>
<p>Notice that the code above doesn&#8217;t even contain a button because I&#8217;m going to create my own graphic to use as a button. To start, I add a Graphic containing a Path and a fill. I don&#8217;t draw my arrow first because, without a fill, I won&#8217;t be able to see the arrow I&#8217;m going to draw. At this point my Graphic code looks like this:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!--- Your arrow will start after this line ---&gt;

&lt;s:Graphic&gt;
	&lt;s:Path data=&quot;&quot;&gt;
		&lt;s:fill&gt;
			&lt;s:LinearGradient rotation=&quot;90&quot;&gt;
				&lt;s:GradientEntry color=&quot;0xfd1901&quot; color.down=&quot;0xAF220D&quot; /&gt;
				&lt;s:GradientEntry color=&quot;0xa70d12&quot; color.down=&quot;0xAF220D&quot; /&gt;
			&lt;/s:LinearGradient&gt;
		&lt;/s:fill&gt;
	&lt;/s:Path&gt;
&lt;/s:Graphic&gt;

&lt;!---- Your arrow will end above this line -----&gt;
</pre>
<p>Now I can begin drawing my arrow. When creating a path, picture your image on grid paper. The lines you draw will run along the grid lines and the fill will color in the middle for you, something like this:</p>
<div width="100%" style="text-align:center;">
<a href="http://www.rabidgadfly.com/wp-content/uploads/arrow.jpg"><img class="aligncenter size-full wp-image-462" title="arrow on grid" src="http://www.rabidgadfly.com/wp-content/uploads/arrow.jpg" alt="" width="282" height="251" /></a>
</div>
<p>The arrow is defined inside the data property of the Graphic and each segment includes a segment type and x/y coordinates relative to the end point of the previous segment. I&#8217;m only going to use a few of the possible segment types, but if you want to see the full list you can check them out <a href="http://docs.huihoo.com/flex/4/spark/primitives/Path.html">here</a>.</p>
<p>Since I don&#8217;t have an end point when I start off, the first command I put in there, &#8220;m 5 20&#8243;, will tell the application that the segment I&#8217;m drawing will start 5 pixels in and 20 pixels down from the top of the Graphic area. If I were drawing the arrow on paper this would mean I was putting my pencil to paper 5 grid squares in and 20 down.</p>
<p>From there I want to draw a horizontal line 15 pixels long and extending to the right of my starting point. &#8220;h 15&#8243; accomplishes the task. If I wanted the line to extend to the left, I would enter &#8220;h -15&#8243;. From that point I want to draw a line, slightly diagonal, that will be the beginning of the arrow head. There&#8217;s no &#8220;d&#8221; for diagonal, so I have to tell it to draw a line to a certain point. In this case, I enter &#8220;l -3 -8&#8243; which draws a line from the end point of my horizontal line and extending 3 pixels to the left and 8 pixel up. Get the idea?</p>
<p>The finished arrow code looks like this:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!--- Your arrow will start after this line ---&gt;

&lt;s:Graphic&gt;
	&lt;s:Path data=&quot;m 5 20
			h 15
			l -3 -8
			l 18 14
			l -18 14
			l 3 -8
			h -18
			v -12&quot;&gt;
		&lt;s:fill&gt;
			&lt;s:LinearGradient rotation=&quot;90&quot;&gt;
				&lt;s:GradientEntry color=&quot;0xfd1901&quot; color.down=&quot;0xAF220D&quot; /&gt;
				&lt;s:GradientEntry color=&quot;0xa70d12&quot; color.down=&quot;0xAF220D&quot; /&gt;
			&lt;/s:LinearGradient&gt;
		&lt;/s:fill&gt;
		&lt;s:stroke&gt;
			&lt;s:SolidColorStroke color=&quot;0xAF220D&quot; weight=&quot;1&quot; alpha=&quot;.8&quot; alpha.disabled=&quot;0&quot;  alpha.up=&quot;0&quot;/&gt;
		&lt;/s:stroke&gt;
	&lt;/s:Path&gt;
&lt;/s:Graphic&gt;

&lt;!---- Your arrow will end above this line -----&gt;
</pre>
<p>That&#8217;s it! My &#8220;Next&#8221; arrow is done. I follow the same process for the Previous button. Then, I add them to my default page, which ends up looking like this:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;s:Application xmlns:fx=&quot;http://ns.adobe.com/mxml/2009&quot;
			   xmlns:s=&quot;library://ns.adobe.com/flex/spark&quot;
			   xmlns:mx=&quot;library://ns.adobe.com/flex/mx&quot; minWidth=&quot;955&quot; minHeight=&quot;600&quot;&gt;

	&lt;s:Button skinClass=&quot;PrevButtonSkin&quot; buttonMode=&quot;true&quot; left=&quot;25&quot; top=&quot;25&quot; /&gt;
	&lt;s:Button skinClass=&quot;NextButtonSkin&quot; buttonMode=&quot;true&quot; left=&quot;100&quot; top=&quot;25&quot; /&gt;

&lt;/s:Application&gt;
 </pre>
<p>The skinClass attribute of the Buttons contains the name of the MXML skin files where I drew the buttons. That&#8217;s all there is to it.</p>
<p>To view or download the complete source, right-click on the app at the top of this post and click &#8220;View Source&#8221;.</p>
<p>-rG</p>
]]></content:encoded>
			<wfw:commentRss>http://rabidgadfly.com/2010/11/create-flex-arrow-buttons-using-spark-path/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Create Your Own Image Buttons In Flex 4</title>
		<link>http://rabidgadfly.com/2010/09/easily-create-image-buttons-flex-4/</link>
		<comments>http://rabidgadfly.com/2010/09/easily-create-image-buttons-flex-4/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 13:34:51 +0000</pubDate>
		<dc:creator>rabidgadfly</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[buttons]]></category>
		<category><![CDATA[flex 4]]></category>

		<guid isPermaLink="false">http://www.rabidgadfly.com/?p=403</guid>
		<description><![CDATA[Flex doesn't offer an image button, but let's say you need one for an application that requires a question mark help button. This short tutorial will walk you through the steps to create it.]]></description>
			<content:encoded><![CDATA[<p>The more I use Flex the more I love its extensibility. Being able to extend, view, or copy the native Flex code makes my job so much easier. Here&#8217;s a short tutorial demonstrating how it can help. I promise there isn&#8217;t much typing involved, but if you just want to skip to the coding and view the final source you can do so by right-clicking the finished help button at the bottom of the post and clicking &#8220;View Source&#8221;.</p>
<p>Flex doesn&#8217;t offer an image button, but let&#8217;s say you need one for an application that requires a question mark help button. Here&#8217;s one way to do it:</p>
<p><span id="more-403"></span></p>
<p><span style="color: #993300;"><em><strong>Quick Note:</strong> The following tutorial assumes that you&#8217;re using Flash Builder 4. If you&#8217;re using another coding environment, the code will remain the same but you may have to modify some of the specified shortcuts or menu options.</em></span></p>
<p>First, create a new project named ImageButtonExample.</p>
<p>Next, create an &#8220;images&#8221; folder under &#8220;src&#8221;.</p>
<p>You&#8217;re going to need some help button images so you can create your own or you can use these:</p>
<table border="0">
<tbody>
<tr>
<td><a href="http://www.rabidgadfly.com/wp-content/uploads/helpnormal.png"><img style="border: 0;" src="http://www.rabidgadfly.com/wp-content/uploads/helpnormal.png" alt="" width="48" height="48" /></a></td>
<td><a href="http://www.rabidgadfly.com/wp-content/uploads/helpover.png"><img style="border: 0;" src="http://www.rabidgadfly.com/wp-content/uploads/helpover.png" alt="" width="48" height="48" /></a></td>
<td><a href="http://www.rabidgadfly.com/wp-content/uploads/helpdown.png"><img style="border: 0pt none;" src="http://www.rabidgadfly.com/wp-content/uploads/helpdown.png" alt="" width="48" height="48" /></a></td>
</tr>
</tbody>
</table>
<p>The three buttons are for three button states: up, over, and down. Save them into the &#8220;images&#8221; folder you just created as helpnormal.png, helpover.png and helpdown.png.  Make sure you refresh your images folder after saving the images into it so your images are recognized by the application. If you forget this step you will receive errors indicating that Flex can&#8217;t find the files.</p>
<p>Next, create a new package named myClasses where you can store the classes you create (best practice is to store your classes in their own package).<span style="color: #3366ff;"><em> [ Right-click "src" and then select New &gt; Package then enter myClasses in the Name field and click Finish ]</em></span>.</p>
<p>Now create a new ActionScript Class in the myClasses package. Call your new Class ImageButton and tell it to use spark.components.Button as its Superclass. <em><span style="color: #3366ff;">[ Right-click myClasses then select New &gt; ActionScript Class. Enter ImageButton in the Name field and spark.components.Button in the Superclass field then click Finish ]</span></em>.</p>
<p>What you end up with should look like this:</p>
<pre class="brush: as3; title: ; notranslate">
package myClasses
{
	import spark.components.Button;

	public class ImageButton extends Button
	{
		public function ImageButton()
		{
			super();
		}
	}
}
</pre>
<p>For the most part, the Spark Button handles almost everything your button needs. I&#8217;ll come back to the need for extending a little later.</p>
<p>For now create a new package named mySkins by following the same procedure you used to create myClasses above.</p>
<p>Create a new Skin for your Button in mySkins named HelpButtonSkin using ImageButton as its Host Component. <em><span style="color: #3366ff;">[ Right-click mySkins then select New &gt; MXML Skin. Enter HelpButtonSkin in the Name field and myClasses.ImageButton in the Host Component field then click Finish ]</span></em>.</p>
<p>What you&#8217;ve been given there in your new Skin is the skin tothe Flex Spark Button. This can be very handy if you just want to make a few small changes. For this project, however, you&#8217;ll be using very little of that code. So, instead of telling you everything you need to remove, I&#8217;m just going to give you the end result:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;

&lt;s:SparkSkin xmlns:fx=&quot;http://ns.adobe.com/mxml/2009&quot;
			 xmlns:s=&quot;library://ns.adobe.com/flex/spark&quot;
			 xmlns:fb=&quot;http://ns.adobe.com/flashbuilder/2009&quot;
			 minWidth=&quot;48&quot; minHeight=&quot;48&quot;
			 alpha.disabled=&quot;0.5&quot;&gt;

	&lt;!-- host component --&gt;
	&lt;fx:Metadata&gt;
		&lt;![CDATA[
		/* @copy spark.skins.spark.ApplicationSkin#hostComponent 	*/
		[HostComponent(&quot;myClasses.ImageButton&quot;)]
		]]&gt;
	&lt;/fx:Metadata&gt;

	&lt;!-- states --&gt;
	&lt;s:states&gt;
		&lt;s:State name=&quot;up&quot; /&gt;
		&lt;s:State name=&quot;over&quot; /&gt;
		&lt;s:State name=&quot;down&quot; /&gt;
		&lt;s:State name=&quot;disabled&quot; /&gt;
	&lt;/s:states&gt;

	&lt;s:Rect left=&quot;0&quot; right=&quot;0&quot; top=&quot;0&quot; bottom=&quot;0&quot; &gt;
		&lt;s:fill&gt;
			&lt;s:SolidColor color=&quot;0xffffff&quot; alpha=&quot;1&quot; /&gt;
		&lt;/s:fill&gt;
	&lt;/s:Rect&gt;

	&lt;s:BitmapImage source=&quot;@Embed('images/helpnormal.png')&quot; includeIn=&quot;up, disabled&quot;/&gt;
	&lt;s:BitmapImage source=&quot;@Embed('images/helpover.png')&quot; includeIn=&quot;over&quot;/&gt;
	&lt;s:BitmapImage source=&quot;@Embed('images/helpdown.png')&quot; includeIn=&quot;down&quot;/&gt;

&lt;/s:SparkSkin&gt;
</pre>
<p>Basically, you&#8217;re replacing everything between the closing states tag and the closing SparkSkin tag with a Rectangle and three BitmapImages. What you&#8217;re doing is creating a hit area for the button by defining a rectangle with an alpha of .1 . This will not be visible but will register when someone rolls over its area. This will allow for some margin of error around your button.</p>
<p>Next, you&#8217;re embedding the three help button images in the skin. They won&#8217;t all appear at the same time because you&#8217;ve told them in which states they should appear by using the includeIn property. The possible states you can used are defined just above the added code. They were put there automatically by Flex because you based the Skin on a Button.</p>
<p>Now open the application mxml file that was created automatically when you created the project. It&#8217;s probably under (default package) and it&#8217;s probably named ImageButtonExample.mxml . Just above the closing Application tag, insert your ImageButton component using &#8220;mySkins.HelpButtonSkin&#8221; as its SkinClass. <em><span style="color: #3366ff;">[ Enter  an opening tag ("&lt;") and begin typing "ImageButton". A dropdown should appear while you're type and it should contain myClasses:ImageButton. DoubleClick it. That will not only complete the component name for you, it will also add myClasses as a namespace in the opening Application tag. After ImageButton enter skinClass="mySkins.HelpButtonSkin" and then close the tag. ]</span></em></p>
<p>Your application file should look like this:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;s:Application xmlns:fx=&quot;http://ns.adobe.com/mxml/2009&quot;
			   xmlns:s=&quot;library://ns.adobe.com/flex/spark&quot;
			   xmlns:mx=&quot;library://ns.adobe.com/flex/mx&quot;
			   xmlns:myClasses=&quot;myClasses.*&quot;
			   minWidth=&quot;955&quot; minHeight=&quot;600&quot; &gt;

	&lt;myClasses:ImageButton skinClass=&quot;mySkins.HelpButtonSkin&quot;  /&gt;

&lt;/s:Application&gt;
</pre>
<p>Now, save all files and run your application. You should see the normal help image in the upper left corner of your browser. If you hover over it and click it, it will change images to the appropriate state image. Pretty slick!</p>
<p>The one thing that&#8217;s lacking at this point is the hand cursor. By default, when you roll over a Spark Button the arrow remains. Luckily, we&#8217;ve already extended the button so we can quickly add that last bit of functionality!</p>
<p>Open ImageButton.as and just below the &#8220;super()&#8221; line add a new line that says &#8220;this.buttonMode=true;&#8221; so that your class now looks like this:</p>
<pre class="brush: as3; title: ; notranslate">
package myClasses
{
	import spark.components.Button;

	public class ImageButton extends Button
	{
		public function ImageButton()
		{
			super();
			this.buttonMode = true;
		}
	}
}
</pre>
<p>Now run your application again and mouse over your button.</p>
<p>Presto, a hand cursor! You&#8217;ve now created your own image button that you can easily reuse or enhance. Great job!</p>
<p>To view the source , right-click on the finished help button below and then click &#8220;View Source&#8221;:</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_ImageButtonExample_530311236"
			class="flashmovie"
			width="50"
			height="50">
	<param name="movie" value="http://www.rabidgadfly.com/swf/imagebuttons/ImageButtonExample.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.rabidgadfly.com/swf/imagebuttons/ImageButtonExample.swf"
			name="fm_ImageButtonExample_530311236"
			width="50"
			height="50">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>-rG</p>
<p><strong>Update:</strong> Creating the ImageButton class is not a necessity, but I think it makes a good example of how to extend a class and modify it for your own purposes. In this particular case, you could use the Spark Button instead of ImageButton in ImageButtonExample.mxml. To get the hand cursor to show up you can specify buttonMode=&#8221;true&#8221; as a property in the tag, like this: &lt;s:Button buttonMode=&#8221;true&#8221; skinClass=&#8221;mySkins.HelpButtonSkin&#8221; /&gt;.</p>
]]></content:encoded>
			<wfw:commentRss>http://rabidgadfly.com/2010/09/easily-create-image-buttons-flex-4/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>How to Style Items in a Flex 4 Spark List</title>
		<link>http://rabidgadfly.com/2010/09/styling-items-in-flex-4-list/</link>
		<comments>http://rabidgadfly.com/2010/09/styling-items-in-flex-4-list/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 16:38:25 +0000</pubDate>
		<dc:creator>rabidgadfly</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[flex 4]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[spark]]></category>

		<guid isPermaLink="false">http://www.rabidgadfly.com/?p=374</guid>
		<description><![CDATA[I&#8217;ve often heard it said that while Flex has a knack for making difficult tasks easy, it also has the same knack for making seemingly easy tasks difficult. While I agree that on occasion it seems that way up front, I usually find that the solution isn&#8217;t usually difficult, just difficult to find. That was [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve often heard it said that while Flex has a knack for making difficult tasks easy, it also has the same knack for making seemingly easy tasks difficult. While I agree that on occasion it seems that way up front, I usually find that the solution isn&#8217;t usually difficult, just difficult to find.</p>
<p>That was the case I found when recently working with the Spark List Component. Dynamically assigning an ArrayList as a Spark List&#8217;s data provider was a quick task and everything worked as expected. I was thrilled. Now I just had to tweak the spacing between the list items and I&#8217;d be finished. Easy, right? Ultimately the answer is yes. However, arriving at the solution took me a couple of hours!</p>
<p>The Spark List component automatically adds cool rollover and select effects. It also allows you to change rollover colors, set the width, and adjust the font size with simple attributes. What it <em>doesn&#8217;t</em> let you do so easily is set the spacing between list items. <em>( Note that I&#8217;m referring to a dynamically populated List, not one in which you define each item individually where you have the luxury of modifying the attributes of each item )</em>.</p>
<p>Here&#8217;s some code to demonstrate the situation:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;s:Application xmlns:fx=&quot;http://ns.adobe.com/mxml/2009&quot;
	xmlns:s=&quot;library://ns.adobe.com/flex/spark&quot;
	xmlns:mx=&quot;library://ns.adobe.com/flex/mx&quot;
	preinitialize=&quot;preinitHandler(event)&quot;  &gt;
	&lt;fx:Script&gt;
		&lt;![CDATA[
		import mx.collections.ArrayList;
		import mx.events.FlexEvent;

		[Bindable]
		private var monthsList:ArrayList;

		protected function preinitHandler(event:FlexEvent):void {
			monthsList = new ArrayList([&quot;January&quot;, &quot;February&quot;, &quot;March&quot;, &quot;April&quot;, &quot;May&quot;, &quot;June&quot;, &quot;July&quot;, &quot;August&quot;, &quot;September&quot;, &quot;October&quot;, &quot;November&quot;,&quot;December&quot;]);
		}
		]]&gt;
	&lt;/fx:Script&gt;

	&lt;s:List id=&quot;months&quot; dataProvider=&quot;{monthsList}&quot; /&gt;
&lt;/s:Application&gt;
</pre>
<p>The code above populates a Spark List with months. Very quick and easy! But now I want to close up the space between the months. Simple padding or gap attribute on the list, right? Nope. lineheight? No. Custom VerticalLayout? Uh uh. Google? Majority of results show examples where each item is defined manually&#8230;that doesn&#8217;t help either.</p>
<p>The answer it turns out is to define a custom ItemRenderer. This is used to tell the results how they should render when displayed. Common sense, right? And it&#8217;s pretty easy to do too:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;s:List id=&quot;months&quot; dataProvider=&quot;{monthsList}&quot; &gt;
	&lt;s:itemRenderer&gt;
		&lt;fx:Component&gt;
			&lt;s:ItemRenderer&gt;
				&lt;s:Label text=&quot;{data}&quot; paddingTop=&quot;3&quot; paddingBottom=&quot;3&quot; fontSize=&quot;11&quot; /&gt;
			&lt;/s:ItemRenderer&gt;
		&lt;/fx:Component&gt;
	&lt;/s:itemRenderer&gt;
&lt;/s:List&gt;
</pre>
<p>You can style the output any way you like by styling the label in the ItemRenderer. Note that if your data source contains multiple &#8220;fields&#8221; with property names, you&#8217;ll need to tweak the label text value slightly to reflect the property name of the value you&#8217;ll be displaying. So, instead of {data}, you would use something like {data.propertyName}.</p>
<p><strong>Bonus tip:</strong> For reusability and flexibility you can define the the ItemRenderer as a separate MXML file and assign it to the itemRenderer property of the Spark List. Even better, you can add the Label style to a style sheet and use it throughout your application.</p>
<p>-rG</p>
]]></content:encoded>
			<wfw:commentRss>http://rabidgadfly.com/2010/09/styling-items-in-flex-4-list/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Font Embedding with Flex 4</title>
		<link>http://rabidgadfly.com/2010/04/font-embedding-with-flash-builder-4/</link>
		<comments>http://rabidgadfly.com/2010/04/font-embedding-with-flash-builder-4/#comments</comments>
		<pubDate>Sat, 01 May 2010 00:41:56 +0000</pubDate>
		<dc:creator>rabidgadfly</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[embed font]]></category>
		<category><![CDATA[flash builder]]></category>
		<category><![CDATA[font]]></category>

		<guid isPermaLink="false">http://www.rabidgadfly.com/?p=321</guid>
		<description><![CDATA[I&#8217;ve been noodling around a bit with Flash Builder 4 lately. After creating a few simple apps I decided to look into font embedding. There are quite a few posts to be found via Googling about embedding fonts in Flex. Some are very good, others not so much, but I think I managed to compile [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been noodling around a bit with Flash Builder 4 lately. After creating a few simple apps I decided to look into font embedding. There are quite a few posts to be found via Googling about embedding fonts in Flex. Some are very good, others not so much, but I think I managed to compile the info into a useful example. My goal was to create custom font swfs, load them into flex, and then apply them to a text field through the use of some type of selector.</p>
<h4>1. Create the Font SWF</h4>
<p><a href="http://www.rabidgadfly.com/wp-content/uploads/charembed.jpg"><img style="border:1px solid #ccc;margin:0 10px 5px 10px;"  src="http://www.rabidgadfly.com/wp-content/uploads/charembed.jpg" alt="Embed Characters" title="Embed Characters" width="350" height="303" class="alignright size-full wp-image-324" /></a>The first step is to use Flash to create a font swf. To do so, create a new Flash document and add a dynamic text field to the stage. Select the text field and choose the font you want to use in your Flex application. Next, click the Character Embedding button from the Property panel and choose the characters that you want available to your Flex application. Choose only the characters you need as each extra character will add unnecessary size. Finally, publish the swf and place a copy in your Flex application folder.</p>
<p>Make a font swf for each font you want to use in your Flex application then close Flash.</p>
<h4>2. Embed the Font SWF</h4>
<p>The next step is to pull those font swfs into your Flex application and create classes, or styleNames, for them. This is done inside the fx:Style tag (mx:Style in Flex 3)</p>
<pre class="brush: xml; title: ; notranslate">
&lt;fx:Style &gt;
		@namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
		@namespace mx &quot;library://ns.adobe.com/flex/mx&quot;;

		@font-face	{
			src: url(&quot;fonts/calvin.swf&quot;);
			font-family: &quot;Calvin and Hobbes&quot;;
		}
		@font-face {
			src:url(&quot;fonts/lcd.swf&quot;);
			font-family:&quot;LCD&quot;;
		}
		@font-face {
			src:url(&quot;fonts/ransom.swf&quot;);
			font-family:&quot;RansomNote&quot;;
		}

		.calvin {font-family: &quot;Calvin and Hobbes&quot;;}
		.lcd {font-family: &quot;LCD&quot;;}
		.ransom {font-family: &quot;RansomNote&quot;;}

	&lt;/fx:Style&gt;
</pre>
<p>Note that the font-family is the name of the font as listed in the Flash IDE. Once this is done I can assign the styleNames &#8220;smack&#8221;, &#8220;square&#8221;, and &#8220;curlz&#8221; to an mx:Text field and it will be presented in that font, something like this:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;mx:Text id=&quot;myText&quot; text=&quot;This is my text&quot; styleName=&quot;calvin&quot;  /&gt;
</pre>
<p>If you stop here you will have a text field using your embedded font.</p>
<h4>3. Create a Font Selector</h4>
<p>We can take this an additional step by adding a radio button group and a simple function to allow dynamic switching between fonts:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;fx:Declarations&gt;
	&lt;s:RadioButtonGroup id=&quot;radiogroup1&quot;/&gt;
&lt;/fx:Declarations&gt;
&lt;mx:Text id=&quot;myText&quot; x=&quot;159&quot; y=&quot;28&quot; text=&quot;Select another font&quot; styleName=&quot;calvin&quot;   fontSize=&quot;20&quot;/&gt;
&lt;s:RadioButton id=&quot;calvin&quot; x=&quot;10&quot; y=&quot;10&quot; label=&quot;Calvin&quot; groupName=&quot;radiogroup1&quot; click=&quot;handleChangeFont(event)&quot; selected=&quot;true&quot;/&gt;
&lt;s:RadioButton id=&quot;lcd&quot; x=&quot;10&quot; y=&quot;36&quot; label=&quot;LCD&quot; groupName=&quot;radiogroup1&quot; click=&quot;handleChangeFont(event)&quot;/&gt;
&lt;s:RadioButton id=&quot;ransom&quot; y=&quot;62&quot; label=&quot;Ransom Note&quot; groupName=&quot;radiogroup1&quot; click=&quot;handleChangeFont(event)&quot; x=&quot;10&quot;/&gt;
</pre>
<p>Note that, as an id for each radiobutton I used the class name they will invoke. This will allow me to use only one line of code in one function to assign the appropriate styleName to my text field:</p>
<pre class="brush: as3; title: ; notranslate">
&lt;fx:Script&gt;
	&lt;![CDATA[

		protected function handleChangeFont(evt:Event):void {
		myText.styleName = evt.target.id;
	        }

	]]&gt;
&lt;/fx:Script&gt;
</pre>
<p>The finished product looks something like this:</p>
<div align="center" style="margin:15px auto;">

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_FontEmbedding_421101686"
			class="flashmovie"
			width="500"
			height="100">
	<param name="movie" value="http://www.rabidgadfly.com/swf/fontembedding/FontEmbedding.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.rabidgadfly.com/swf/fontembedding/FontEmbedding.swf"
			name="fm_FontEmbedding_421101686"
			width="500"
			height="100">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
</div>
<p style="margin:5px 5px 20px 5px;">Right-click on the swf and then click &#8220;View Source&#8221; to view or download the source.</p>
]]></content:encoded>
			<wfw:commentRss>http://rabidgadfly.com/2010/04/font-embedding-with-flash-builder-4/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Flex Camp Boston</title>
		<link>http://rabidgadfly.com/2007/11/flex-camp-boston/</link>
		<comments>http://rabidgadfly.com/2007/11/flex-camp-boston/#comments</comments>
		<pubDate>Tue, 06 Nov 2007 17:33:16 +0000</pubDate>
		<dc:creator>rabidgadfly</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.rabidgadfly.com/?p=54</guid>
		<description><![CDATA[My good friend and ColdFusion Guru Brian Rinaldi of RemoteSynthesis fame is organizing his first conference. Flex Camp Boston will take place on December 7, 2007 at Bentley College in Waltham, MA. For a $10 admission charge you&#8217;ll hear from an impressive group of speakers on a wide array of Flex-related topics. Not a good [...]]]></description>
			<content:encoded><![CDATA[<p>My good friend and ColdFusion Guru Brian Rinaldi of <a href="http://www.remotesynthesis.com/blog/">RemoteSynthesis</a> fame is organizing his first conference. <a href="http://www.remotesynthesis.com/blog/index.cfm/2007/11/1/Flex-Camp-Boston-Registration-is-Open">Flex Camp Boston</a> will take place on December 7, 2007 at Bentley College in Waltham, MA. For a $10 admission charge you&#8217;ll hear from an impressive group of <a href="http://www.flexcampboston.com/page.cfm/agenda">speakers</a> on a wide array of Flex-related topics. Not a good enough deal for you? Well, they&#8217;re throwing in parking and lunch too!</p>
<p>This is a great opportunity to meet with some of the leaders of the Flex Community. <a href="http://www.flexcampboston.com/page.cfm/register">Take advantage of it</a>!</p>
<p>-rG</p>
]]></content:encoded>
			<wfw:commentRss>http://rabidgadfly.com/2007/11/flex-camp-boston/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Populate a Flex Accordion with XML</title>
		<link>http://rabidgadfly.com/2007/05/populate-a-flex-accordion-with-xml/</link>
		<comments>http://rabidgadfly.com/2007/05/populate-a-flex-accordion-with-xml/#comments</comments>
		<pubDate>Fri, 11 May 2007 12:39:22 +0000</pubDate>
		<dc:creator>rabidgadfly</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.rabidgadfly.com/?p=36</guid>
		<description><![CDATA[I&#8217;ve been spending a lot of time lately learning Flex. So far I think it&#8217;s fantastic. I&#8217;m amazed at how easy it is to put together a nice looking dynamic application with so little code. One stumbling block I had to get over was populating an accordion component with data from an XML document. I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been spending a lot of time lately learning Flex. So far I think it&#8217;s fantastic. I&#8217;m amazed at how easy it is to put together a nice looking dynamic application with so little code.</p>
<p>One stumbling block I had to get over was populating an accordion component with data from an XML document. I started off with a tab bar which was pretty easy, but I felt the accordion would be a better fit for my application so I started looking into the available samples.</p>
<p>Unfortunately, all of the samples I encountered either used static data or a data grid which I didn&#8217;t need. So I cracked my knuckles and set off to figure it out the old-fashioned way&#8230;without help from the web.</p>
<p>It was easy enough to populate the accordion sections with the XML, however, I was working with a list of videos and I wanted the video to begin playing when its title was clicked in the accordion. When I worked with the tab bar I just used separate states for each video type (commercials, demos, trailers) which allowed me to always use the same id name and data provider.</p>
<p>With the accordion I didn&#8217;t feel that states were necessary and I preferred to place it all in the same state if possible. I ended up assigning the appropriate node to each accordion and dynamically changing the video source when a different video type was selected. My accordion looks something like this (srv is an HTTPService reference to my video.xml file):</p>
<pre>
<code>
<mx:Accordion id="accordion" >
       <mx:VBox label="Demos">
		<mx:List id="demosList" dataProvider="{srv.lastResult.demo.video}" itemClick="chgVidSource(demosList.selectedItem.url)" />
       </mx:VBox>
            <mx:VBox label="Commercials" >
		<mx:List id="commercialsList" dataProvider="{srv.lastResult.commercial.video}" itemClick="chgVidSource(commercialsList.selectedItem.url)" />
            </mx:VBox>
            <mx:VBox label="Trailers">
		<mx:List id="trailersList" dataProvider="{srv.lastResult.trailer.video}"  itemClick="chgVidSource(trailersList.selectedItem.url)" />
            </mx:VBox>
</mx:Accordion>
</code>
</pre>
<p>You can see that my dataProvider changes to a different node for each accordion section. I initially attempted to use the same id for each section but received an error stating that I couldn&#8217;t use the same id more than once. That meant that I had to come up with a way to dynamically change my video source based on the accordion section that was open.</p>
<p>I achieved the swap with a variable and a short function:</p>
<pre>
<code>
    <mx:Script>
        <![CDATA[
            [Bindable]
            public var vidSource:String;
            private function chgVidSource(newSource:String):void {
            	vidSource = "http://www.rabidtube.com/flv/"+newSource;
            	myVid.play();
            }

       ]]&gt;
    </mx:Script>
</code>
</pre>
<p>To complete the picture, my VideoDisplay looks like this:</p>
<pre>
<code>
<mx:VideoDisplay id="myVid" source="{vidSource}" />
</code>
</pre>
<p>As you can see I defined my VideoDisplay source as the value of my vidSource variable which gets updated by the chgVidSource function that is called when the accordion section changes. This is achieved by defining itemClick in each accordion section&#8217;s List tag to send the chgVidSource function the url of the selected video.</p>
<p>To further clarify the code, here is a sample of the xml format I used:</p>
<pre><code>
<commercial>
	<video>
	  <label>Montgomery Mini Mall</label>
	  <url>minimall.flv</url>
	</video>
</commercial>
<demo>
	<video>
	  <label>Playable Demo</label>
	  <url>demo.flv</url>
	</video>
</demo>
<trailer>
	<video>
	  <label>Transformers</label>
	  <url>tf07.flv</url>
	</video>
</trailer>
</code></pre>
<p>Hope that helps! If anyone has suggestions on how to do this differently please let me know. I&#8217;m pretty green with Flex and I&#8217;m always looking for a better way.</p>
<p>-rG</p>
]]></content:encoded>
			<wfw:commentRss>http://rabidgadfly.com/2007/05/populate-a-flex-accordion-with-xml/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

