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

<channel>
	<title>SmartLogic Solutions Blog &#187; Flex</title>
	<atom:link href="http://blog.smartlogicsolutions.com/category/flex/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>Displaying an Image in a ComboBox</title>
		<link>http://blog.smartlogicsolutions.com/2008/12/01/displaying-an-image-in-a-combobox/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/12/01/displaying-an-image-in-a-combobox/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 16:17:53 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[ComboBox]]></category>
		<category><![CDATA[Image]]></category>

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

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

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

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

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

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

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=357</guid>
		<description><![CDATA[There are a few ways to style the tabs in a TabBar that are fairly well hidden. Here are a couple methods that hopefully save some time for those of you out there looking to apply advanced styles tabs in Flex. If you need to style the tabs uniformly, then you&#8217;ve got little work to [...]]]></description>
			<content:encoded><![CDATA[<p>There are a few ways to style the tabs in a TabBar that are fairly well hidden.  Here are a couple methods that hopefully save some time for those of you out there looking to apply advanced styles tabs in Flex.</p>
<p>If you need to style the tabs uniformly, then you&#8217;ve got little work to do.  Just set the <strong>StyleName</strong> attribute on the TabBar itself and just define it in your stylesheet.</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:TabBar</span> id=<span style="color: #ff0000;">&quot;tabBar&quot;</span> styleName=<span style="color: #ff0000;">&quot;myTabBarStyle&quot;</span>  <span style="color: #7400FF;">/&gt;</span></span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.myTabBarStyle</span> <span style="color: #00AA00;">&#123;</span>
	tabHeight<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">28</span><span style="color: #00AA00;">;</span>
	cornerRadius<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	horizontalGap<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	horizontalAlign<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
	backgroundAlpha<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
	backgroundColor<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#357cc6</span><span style="color: #00AA00;">;</span>
	borderStyle<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	borderThickness<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	dropShadowEnabled<span style="color: #00AA00;">:</span> false<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Now that&#8217;s all good and well when all your tabs look the same.  What if you want to apply styles to tabs individually?  Well, if you&#8217;ve got 3 tabs or less you can use some css selectors to reference the book ends specifically, and let the general style apply to the middle tab.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">.myTabBarStyle<span style="color: #00AA00;">&#123;</span>
    ...
  tabStyleName<span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;greenTab&quot;</span><span style="color: #00AA00;">;</span>
  firstTabStyleName<span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;blueTab&quot;</span><span style="color: #00AA00;">;</span>
  lastTabStyleName<span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;yellowTab&quot;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.greenTab</span> <span style="color: #00AA00;">&#123;</span>
  fillColors<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#a5d414</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#87c408</span><span style="color: #00AA00;">;</span>
  backgroundColor<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#87c408</span><span style="color: #00AA00;">;</span>
   borderColor<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#87c408</span><span style="color: #00AA00;">;</span>
  themeColor<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#a5d414</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.blueTab</span> <span style="color: #00AA00;">&#123;</span>
  fillColors<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#5a9cd6</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#357cc6</span><span style="color: #00AA00;">;</span>
  backgroundColor<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#357cc6</span><span style="color: #00AA00;">;</span>
  borderColor<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#357cc6</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;">;</span>
  textRollOverColor<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;">;</span>
  themeColor<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#5a9cd6</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.yellowTab</span> <span style="color: #00AA00;">&#123;</span>
  fillColors<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#333333</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#333333</span><span style="color: #00AA00;">;</span>
  backgroundColor<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#333333</span><span style="color: #00AA00;">;</span>
  borderColor<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#646464</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#F8ED6D</span><span style="color: #00AA00;">;</span>
  textRollOverColor<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#F8ED6D</span><span style="color: #00AA00;">;</span>
  themeColor<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#646464</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>When you have 4 or more tags, you need to set their styles by getting a reference to the tab <em>itself</em> and call the <strong>setStyle()</strong> method.  Straight forward? Yes. Easy to find information about? No&#8230; in fact I ran into trouble because there wasn&#8217;t any documentation available for an individual tab&#8217;s class and FlexBuilder 3 has no source code for the mx.controls.tabBarClasses package.</p>
<p>Import the Tab code, get a reference to the tab you wish to style, and call setStyle() for each attribute you want to change. Let&#8217;s say you have 4 tabs and each has a different style.  You can combine all 3 methods of styling by using the css code above to set the tab style for all tabs in the tabBar, override styles for the first and last tabs, then specifically grab the 3rd tab and override its style in the component:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">  <span style="color: #66cc66;">&lt;</span>mx: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: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">tabBarClasses</span>.<span style="color: #0066CC;">Tab</span>
&nbsp;
       <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> tabBarCreationComplete<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	  <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">tab</span>:<span style="color: #0066CC;">Tab</span> = tabBar.<span style="color: #006600;">getChildAt</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span> as <span style="color: #0066CC;">Tab</span>;			  
	  <span style="color: #0066CC;">tab</span>.<span style="color: #0066CC;">setStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;fillColors&quot;</span>, <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;#edb000&quot;</span>, <span style="color: #ff0000;">&quot;#e69500&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
          <span style="color: #0066CC;">tab</span>.<span style="color: #0066CC;">setStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;backgroundColor&quot;</span>, <span style="color: #ff0000;">&quot;#e69500&quot;</span><span style="color: #66cc66;">&#41;</span>;
          <span style="color: #0066CC;">tab</span>.<span style="color: #0066CC;">setStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;borderColor&quot;</span>, <span style="color: #ff0000;">&quot;#e69500&quot;</span><span style="color: #66cc66;">&#41;</span>;
          <span style="color: #0066CC;">tab</span>.<span style="color: #0066CC;">setStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;themeColor&quot;</span>, <span style="color: #ff0000;">&quot;#edb000&quot;</span><span style="color: #66cc66;">&#41;</span>;
       <span style="color: #66cc66;">&#125;</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>mx:Script<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>And update the TabBar control:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;">  <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:TabBar</span> id=<span style="color: #ff0000;">&quot;tabBar&quot;</span> </span>
<span style="color: #000000;">                     styleName=<span style="color: #ff0000;">&quot;myTabBarStyle&quot;</span></span>
<span style="color: #000000;">                     creationComplete=<span style="color: #ff0000;">&quot;tabBarCreationComplete();&quot;</span>  <span style="color: #7400FF;">/&gt;</span></span></pre></div></div>

<p>You can iterate through each tab in the TabBar and set each tab individually if desired.  I hope this helps some Flex developers out there who are confused by styling many tabs individually!</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/01/22/ubuntu-byobu-landscape/" rel="bookmark" class="crp_title">Using Byobu and Landscape to improve remote Ubuntu sessions</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/10/21/advanced-css-in-flex-4-id-and-descendant-selectors/" rel="bookmark" class="crp_title">Advanced CSS in Flex 4 &#8211; ID and Descendant Selectors</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/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/2007/06/06/eclipse-32-and-out-of-memory-errors/" rel="bookmark" class="crp_title">Eclipse 3.2 and &#8220;Out Of Memory&#8221; errors</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/11/10/flex-3-styling-individual-tabs-in-a-tabbar/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Making WillPaginate and Rails to_xml play nice with ActiveResource</title>
		<link>http://blog.smartlogicsolutions.com/2008/10/10/making-willpaginate-and-rails-to_xml-play-nice-with-activeresource/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/10/10/making-willpaginate-and-rails-to_xml-play-nice-with-activeresource/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 19:48:57 +0000</pubDate>
		<dc:creator>Scott Davis</dc:creator>
				<category><![CDATA[ActiveRecord]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Scott Davis]]></category>
		<category><![CDATA[Serialization]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[Rails Will_Paginate to_xml ActiveResource]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=305</guid>
		<description><![CDATA[We are currently working on a project that involves Flex and active resource + will_paginate and we needed to be able to paginate the xml transactions easily. Unfortunately, will_paginate and to_xml don&#8217;t play nicely when it comes to adding the current_page, total_pages, and page attributes to the xml. After many failed attempts I went looking around github [...]]]></description>
			<content:encoded><![CDATA[<p>We are currently working on a project that involves Flex and active resource + will_paginate and we needed to be able to paginate the xml transactions easily. Unfortunately, will_paginate and to_xml don&#8217;t play nicely when it comes to adding the current_page, total_pages, and page attributes to the xml. After many failed attempts I went looking around <a href="http://github.com">github</a> and found in a few <a href="http://github.com/agile/will_paginate/tree/master">forks</a> of <a href="http://github.com/mislav/will_paginate/tree/master/">will paginate</a> that some people had solved this problem but, I didn&#8217;t want to install another version of the gem to risk breaking other apps on the server so I did it the rails way!</p>
<p>I started by creating a module that opens up the will_paginate <a href="http://github.com/mislav/will_paginate/tree/master/lib/will_paginate/collection.rb">collection</a> class and includes ActiveResource and alias method chain the to_xml method to include these values. Example code below.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#enviroment.rb</span>
...
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'to_xml_extensions'</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#lib/to_xml_extensions.rb</span>
<span style="color:#9966CC; font-weight:bold;">module</span> WillPaginateHelpers
  <span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#6666ff; font-weight:bold;">ActiveSupport::CoreExtensions</span>::<span style="color:#CC0066; font-weight:bold;">Array</span>::Conversions
  <span style="color:#9966CC; font-weight:bold;">def</span> to_xml_with_collection_type<span style="color:#006600; font-weight:bold;">&#40;</span>options = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        serializeable_collection.<span style="color:#9900CC;">to_xml_without_collection_type</span><span style="color:#006600; font-weight:bold;">&#40;</span>options<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>xml<span style="color:#006600; font-weight:bold;">|</span>
          xml.<span style="color:#9900CC;">tag</span>!<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:current_page</span>, <span style="color:#006600; font-weight:bold;">&#123;</span>:type <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveSupport::CoreExtensions</span>::<span style="color:#CC00FF; font-weight:bold;">Hash</span>::<span style="color:#6666ff; font-weight:bold;">Conversions::XML_TYPE_NAMES</span><span style="color:#006600; font-weight:bold;">&#91;</span>current_page.<span style="color:#9966CC; font-weight:bold;">class</span>.<span style="color:#9900CC;">name</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#125;</span>, current_page<span style="color:#006600; font-weight:bold;">&#41;</span>
          xml.<span style="color:#9900CC;">tag</span>!<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:per_page</span>, <span style="color:#006600; font-weight:bold;">&#123;</span>:type <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveSupport::CoreExtensions</span>::<span style="color:#CC00FF; font-weight:bold;">Hash</span>::<span style="color:#6666ff; font-weight:bold;">Conversions::XML_TYPE_NAMES</span><span style="color:#006600; font-weight:bold;">&#91;</span>per_page.<span style="color:#9966CC; font-weight:bold;">class</span>.<span style="color:#9900CC;">name</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#125;</span>, per_page<span style="color:#006600; font-weight:bold;">&#41;</span>
          xml.<span style="color:#9900CC;">tag</span>!<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:total_entries</span>, <span style="color:#006600; font-weight:bold;">&#123;</span>:type <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveSupport::CoreExtensions</span>::<span style="color:#CC00FF; font-weight:bold;">Hash</span>::<span style="color:#6666ff; font-weight:bold;">Conversions::XML_TYPE_NAMES</span><span style="color:#006600; font-weight:bold;">&#91;</span>total_entries.<span style="color:#9966CC; font-weight:bold;">class</span>.<span style="color:#9900CC;">name</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#125;</span>, total_entries<span style="color:#006600; font-weight:bold;">&#41;</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>.<span style="color:#CC0066; font-weight:bold;">sub</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">%</span><span style="color:#006600; font-weight:bold;">&#123;</span>type=<span style="color:#996600;">&quot;array&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span>, <span style="color:#006600; font-weight:bold;">%</span><span style="color:#006600; font-weight:bold;">&#123;</span>type=<span style="color:#996600;">&quot;collection&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
      alias_method_chain <span style="color:#ff3333; font-weight:bold;">:to_xml</span>, <span style="color:#ff3333; font-weight:bold;">:collection_type</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">def</span> serializeable_collection <span style="color:#008000; font-style:italic;">#:nodoc:</span>
        <span style="color:#008000; font-style:italic;"># Ugly hack because to_xml will not yield the XML Builder object when empty?</span>
        empty? ? returning<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">clone</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>c<span style="color:#006600; font-weight:bold;">|</span> c.<span style="color:#9900CC;">instance_eval</span> <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>i<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#9966CC; font-weight:bold;">def</span> empty?; <span style="color:#0000FF; font-weight:bold;">false</span>; <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#006600; font-weight:bold;">&#125;</span> : <span style="color:#0000FF; font-weight:bold;">self</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#6666ff; font-weight:bold;">WillPaginate::Collection</span>.<span style="color:#9900CC;">send</span><span style="color:#006600; font-weight:bold;">&#40;</span>:<span style="color:#9966CC; font-weight:bold;">include</span>, WillPaginateHelpers<span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>This now gives me the proper xml when I call to_xml</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;time-cards</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;collection&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;current_page</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;integer&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/current_page<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;per_page</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;integer&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>25<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/per_page<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;total_entries</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;integer&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>108<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/total_entries<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;time_card<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;approved</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;boolean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/approved<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;billable</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;boolean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/billable<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;created_at</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;datetime&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>2008-10-10T14:04:13-04:00<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/created_at<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;date</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;datetime&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>2008-10-10T14:04:13-04:00<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;has_been_billed</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;boolean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/has_been_billed<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;has_been_paid</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;boolean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/has_been_paid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;hours</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;float&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>2.0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/hours<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;integer&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>98<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;is_overtime</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;boolean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/is_overtime<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;task_id</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;integer&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>6<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/task_id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;updated_at</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;datetime&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>2008-10-10T14:04:13-04:00<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/updated_at<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;user_id</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;integer&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/user_id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/time_card<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  ...
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/timecards<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/10/28/faking-a-will-paginate-collection-on-an-active-resource-model/" rel="bookmark" class="crp_title">Faking a Will Paginate Collection on an Active Resource model</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/06/13/ruby-on-rails-polymorphic-association-benchmarks/" rel="bookmark" class="crp_title">Ruby on Rails Polymorphic Association Benchmarks</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/07/01/microsoft-webdav-opens-document-as-read-only-when-using-railsdav/" rel="bookmark" class="crp_title">Microsoft WebDav opens document as Read-Only when using RailsDav</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/09/10/using-activerecords-to_xml-to-produce-custom-xml-including-deep-level-associations/" rel="bookmark" class="crp_title">Using ActiveRecord&#8217;s to_xml to produce custom xml including deep level associations</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/06/03/error-in-will_paginate-gem-running-rails-210/" rel="bookmark" class="crp_title">Error in will_paginate gem running Rails 2.1.0</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/10/10/making-willpaginate-and-rails-to_xml-play-nice-with-activeresource/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Migrating Serialization Changes Within an AIR Application</title>
		<link>http://blog.smartlogicsolutions.com/2008/09/11/migrating-serialization-changes-within-an-air-application/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/09/11/migrating-serialization-changes-within-an-air-application/#comments</comments>
		<pubDate>Thu, 11 Sep 2008 06:50:07 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[Serialization]]></category>
		<category><![CDATA[Migration]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=255</guid>
		<description><![CDATA[I just submitted my entry to the AIR Cookbook for the AIR Cookbook Cook-off. It solves the problem of having your AIR application store an IExternalizable class on disk but then later adding more fields to that class. How would you read the old version of the class without encountering a runtime error if you [...]]]></description>
			<content:encoded><![CDATA[<p>I just submitted <a href="http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&#038;postid=10743&#038;loc=en_US&#038;productid=4">my entry</a> to the <a href="http://www.adobe.com/go/air_cookbook">AIR Cookbook</a> for the <a href="http://www.adobe.com/devnet/logged_in/mkoch_aircookoff.html">AIR Cookbook Cook-off</a>.</p>
<p>It solves the problem of having your AIR application store an <code>IExternalizable</code> class on disk but then later adding more fields to that class.  How would you read the old version of the class without encountering a runtime error if you tried to read the new field that wasn&#8217;t present in the older serialization?</p>
<p>Go <a href="http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&#038;postid=10743&#038;loc=en_US&#038;productid=4">check it out</a> the cookbook entry to find out how to do this and please rate the article!</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/10/29/i-won-the-air-cook-off/" rel="bookmark" class="crp_title">I Won the AIR Cook-off</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/11/17/migrairable-library-added-to-google-code/" rel="bookmark" class="crp_title">MigrAIRable Library Added to Google Code</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/02/25/flex-air-released-adobe/" rel="bookmark" class="crp_title">AIR 1.0 and Flex 3 Released</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/03/31/air-linux-adobe-alpha-flexbuilder/" rel="bookmark" class="crp_title">Adobe AIR Alpha Released on Linux</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/08/27/serialization-errorbug-when-using-bytearray-readobject-iexternalizable-class/" rel="bookmark" class="crp_title">Serialization Error/Bug When Using a ByteArray and readObject in an IExternalizable Class?</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/09/11/migrating-serialization-changes-within-an-air-application/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Serialization Error/Bug When Using a ByteArray and readObject in an IExternalizable Class?</title>
		<link>http://blog.smartlogicsolutions.com/2008/08/27/serialization-errorbug-when-using-bytearray-readobject-iexternalizable-class/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/08/27/serialization-errorbug-when-using-bytearray-readobject-iexternalizable-class/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 14:21:46 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[Serialization]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=200</guid>
		<description><![CDATA[I&#8217;ve encountered some odd behavior that I would have expected to work when calling readObject() to de-serialize an array of anonymous objects. If anyone knows what&#8217;s going on here, please enlighten me. I&#8217;ve also filed a bug on Adobe&#8217;s bug tracking system if anyone wants to follow the progress at Adobe&#8217;s end. I&#8217;m trying to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve encountered some odd behavior that I would have expected to work when calling <code>readObject()</code> to de-serialize an array of anonymous objects.  If anyone knows what&#8217;s going on here, please enlighten me.  I&#8217;ve also <a href="http://bugs.adobe.com/jira/browse/FP-601">filed a bug</a> on Adobe&#8217;s bug tracking system if anyone wants to follow the progress at Adobe&#8217;s end.</p>
<p>I&#8217;m trying to read all of the bytes in the <code>readExternal()</code> function of a class implementing <code>IExternalizable</code>, so that I may use the <code>position</code> property to move back in stream in case I need to do so.  The problem only seems to occur if I am trying to de-serialize an Array of anonymous objects.  If I put plain old Strings in the Array it will work fine.  I find this odd since I would expect</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> readExternal<span style="color: #66cc66;">&#40;</span>input:IDataInput<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">var</span> arr:<span style="color: #0066CC;">Array</span> = input.<span style="color: #006600;">readObject</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> as <span style="color: #0066CC;">Array</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>to have the exact same behavior as:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> readExternal<span style="color: #66cc66;">&#40;</span>input:IDataInput<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">var</span> ba:ByteArray = <span style="color: #000000; font-weight: bold;">new</span> ByteArray<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; 
  <span style="color: #000000; font-weight: bold;">var</span> inputBytes:uint = input.<span style="color: #006600;">bytesAvailable</span>;
  input.<span style="color: #006600;">readBytes</span><span style="color: #66cc66;">&#40;</span>ba<span style="color: #66cc66;">&#41;</span>;
  <span style="color: #000000; font-weight: bold;">var</span> baBytes:uint = ba.<span style="color: #006600;">bytesAvailable</span>;
  <span style="color: #000000; font-weight: bold;">var</span> arr:<span style="color: #0066CC;">Array</span> = ba.<span style="color: #006600;">readObject</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> as <span style="color: #0066CC;">Array</span>;
  <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;inputBytes == baBytes ?= &quot;</span> + <span style="color: #66cc66;">&#40;</span>inputBytes == baBytes<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// traces &quot;inputBytes == baBytes ?= true</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>AIR installer and code attached below&#8230; <span id="more-200"></span></p>
<p>The classes I&#8217;m trying to serialize are simple as I&#8217;m only trying to serialize an Array in this test application.  (Excuse the poor code of assuming the items in the Array are Objects in the <code>toString()</code function).</p>
<h4>io/WorkingSerializer.as</h4>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package io <span style="color: #66cc66;">&#123;</span>
&nbsp;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">IExternalizable</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">IDataInput</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">IDataOutput</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> WorkingSerializer <span style="color: #0066CC;">implements</span> IExternalizable <span style="color: #66cc66;">&#123;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> arr:<span style="color: #0066CC;">Array</span>;
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> WorkingSerializer<span style="color: #66cc66;">&#40;</span>a:<span style="color: #0066CC;">Array</span>=<span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			arr = a ? a : <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> readExternal<span style="color: #66cc66;">&#40;</span>input:IDataInput<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			arr = input.<span style="color: #006600;">readObject</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> as <span style="color: #0066CC;">Array</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> writeExternal<span style="color: #66cc66;">&#40;</span>output:IDataOutput<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			output.<span style="color: #006600;">writeObject</span><span style="color: #66cc66;">&#40;</span>arr<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">String</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> s:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;&quot;</span>;
			<span style="color: #b1b100;">for</span> <span style="color: #b1b100;">each</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> obj:<span style="color: #0066CC;">Object</span> <span style="color: #b1b100;">in</span> arr<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
				s += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span>{ &quot;</span>;
				<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> p:<span style="color: #0066CC;">String</span> <span style="color: #b1b100;">in</span> obj<span style="color: #66cc66;">&#41;</span>
					s += p + <span style="color: #ff0000;">&quot;: &quot;</span> + obj<span style="color: #66cc66;">&#91;</span>p<span style="color: #66cc66;">&#93;</span> + <span style="color: #ff0000;">&quot;,&quot;</span>;
				s += <span style="color: #ff0000;">&quot; }<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #ff0000;">&quot;[WorkingSerializer]<span style="color: #000099; font-weight: bold;">\n</span> arr: [ &quot;</span> + s + <span style="color: #ff0000;">&quot;]&quot;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<h4>io/ProblemSerializer.as</h4>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package io <span style="color: #66cc66;">&#123;</span>
&nbsp;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">ByteArray</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">IExternalizable</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">IDataInput</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">IDataOutput</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ProblemSerializer <span style="color: #0066CC;">implements</span> IExternalizable <span style="color: #66cc66;">&#123;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> arr:<span style="color: #0066CC;">Array</span>;
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> ProblemSerializer<span style="color: #66cc66;">&#40;</span>a:<span style="color: #0066CC;">Array</span>=<span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			arr = a ? a : <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> readExternal<span style="color: #66cc66;">&#40;</span>input:IDataInput<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> ba:ByteArray = <span style="color: #000000; font-weight: bold;">new</span> ByteArray<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			input.<span style="color: #006600;">readBytes</span><span style="color: #66cc66;">&#40;</span>ba<span style="color: #66cc66;">&#41;</span>;
			arr = ba.<span style="color: #006600;">readObject</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> as <span style="color: #0066CC;">Array</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> writeExternal<span style="color: #66cc66;">&#40;</span>output:IDataOutput<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			output.<span style="color: #006600;">writeObject</span><span style="color: #66cc66;">&#40;</span>arr<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">String</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> s:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;&quot;</span>;
			<span style="color: #b1b100;">for</span> <span style="color: #b1b100;">each</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> obj:<span style="color: #0066CC;">Object</span> <span style="color: #b1b100;">in</span> arr<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
				s += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span>{ &quot;</span>;
				<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> p:<span style="color: #0066CC;">String</span> <span style="color: #b1b100;">in</span> obj<span style="color: #66cc66;">&#41;</span>
					s += p + <span style="color: #ff0000;">&quot;: &quot;</span> + obj<span style="color: #66cc66;">&#91;</span>p<span style="color: #66cc66;">&#93;</span> + <span style="color: #ff0000;">&quot;,&quot;</span>;
				s += <span style="color: #ff0000;">&quot; }<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #ff0000;">&quot;[ProblemSerializer]<span style="color: #000099; font-weight: bold;">\n</span> arr: [ &quot;</span> + s + <span style="color: #ff0000;">&quot;]&quot;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>And here is the main application file.  I wrote it as an <a href="http://www.adobe.com/go/air">AIR</a> application so install AIR first if you don't have it.</p>
<h4>SerializationIssue.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>mx:WindowedApplication xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> creationComplete=<span style="color: #ff0000;">&quot;init()&quot;</span>
						layout=<span style="color: #ff0000;">&quot;vertical&quot;</span> horizontalAlign=<span style="color: #ff0000;">&quot;center&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;500&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;500&quot;</span><span style="color: #66cc66;">&gt;</span>
&nbsp;
	<span style="color: #66cc66;">&lt;</span>mx: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: #0066CC;">import</span> io.<span style="color: #66cc66;">*</span>;
&nbsp;
			<span style="color: #0066CC;">private</span> const WORKING:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;workingfile_v1&quot;</span>;
			<span style="color: #0066CC;">private</span> const PROBLEM:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;problemfile_v1&quot;</span>;
&nbsp;
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				registerClassAlias<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;io.WorkingSerializer&quot;</span>, io.<span style="color: #006600;">WorkingSerializer</span><span style="color: #66cc66;">&#41;</span>;
				registerClassAlias<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;io.ProblemSerializer&quot;</span>, io.<span style="color: #006600;">ProblemSerializer</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
				<span style="color: #000000; font-weight: bold;">var</span> wo:WorkingSerializer = <span style="color: #000000; font-weight: bold;">new</span> WorkingSerializer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#123;</span>obj: <span style="color: #ff0000;">&quot;some&quot;</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span>obj: <span style="color: #ff0000;">&quot;items&quot;</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span>obj: <span style="color: #ff0000;">&quot;are&quot;</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span>obj: <span style="color: #ff0000;">&quot;here&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #000000; font-weight: bold;">var</span> s:FileStream = <span style="color: #000000; font-weight: bold;">new</span> FileStream<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				s.<span style="color: #006600;">open</span><span style="color: #66cc66;">&#40;</span>getFile<span style="color: #66cc66;">&#40;</span>WORKING<span style="color: #66cc66;">&#41;</span>, FileMode.<span style="color: #006600;">WRITE</span><span style="color: #66cc66;">&#41;</span>;
				s.<span style="color: #006600;">writeObject</span><span style="color: #66cc66;">&#40;</span>wo<span style="color: #66cc66;">&#41;</span>;
				s.<span style="color: #0066CC;">close</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
				<span style="color: #000000; font-weight: bold;">var</span> po:ProblemSerializer = <span style="color: #000000; font-weight: bold;">new</span> ProblemSerializer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#123;</span>obj: <span style="color: #ff0000;">&quot;items&quot;</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span>obj: <span style="color: #ff0000;">&quot;in&quot;</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span>obj: <span style="color: #ff0000;">&quot;problem&quot;</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span>obj: <span style="color: #ff0000;">&quot;serializer&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
				s.<span style="color: #006600;">open</span><span style="color: #66cc66;">&#40;</span>getFile<span style="color: #66cc66;">&#40;</span>PROBLEM<span style="color: #66cc66;">&#41;</span>, FileMode.<span style="color: #006600;">WRITE</span><span style="color: #66cc66;">&#41;</span>;
				s.<span style="color: #006600;">writeObject</span><span style="color: #66cc66;">&#40;</span>po<span style="color: #66cc66;">&#41;</span>;
				s.<span style="color: #0066CC;">close</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> getFile<span style="color: #66cc66;">&#40;</span>filename:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:File <span style="color: #66cc66;">&#123;</span> <span style="color: #b1b100;">return</span> File.<span style="color: #006600;">applicationStorageDirectory</span>.<span style="color: #006600;">resolvePath</span><span style="color: #66cc66;">&#40;</span>filename<span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span>
&nbsp;
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> readObj<span style="color: #66cc66;">&#40;</span>readWorking:<span style="color: #0066CC;">Boolean</span>=<span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">var</span> s:FileStream = <span style="color: #000000; font-weight: bold;">new</span> FileStream<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				s.<span style="color: #006600;">open</span><span style="color: #66cc66;">&#40;</span>getFile<span style="color: #66cc66;">&#40;</span>readWorking ? WORKING : PROBLEM<span style="color: #66cc66;">&#41;</span>, FileMode.<span style="color: #006600;">READ</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>readWorking<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
					<span style="color: #000000; font-weight: bold;">var</span> wo:WorkingSerializer = s.<span style="color: #006600;">readObject</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> as WorkingSerializer;
					logger.<span style="color: #0066CC;">text</span> += wo + <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
					<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>wo<span style="color: #66cc66;">&#41;</span>;
				<span style="color: #66cc66;">&#125;</span>
				<span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
					<span style="color: #000000; font-weight: bold;">var</span> po:ProblemSerializer = s.<span style="color: #006600;">readObject</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> as ProblemSerializer;
					logger.<span style="color: #0066CC;">text</span> += po + <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
					<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>po<span style="color: #66cc66;">&#41;</span>;
				<span style="color: #66cc66;">&#125;</span>
				s.<span style="color: #0066CC;">close</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</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>mx:Script<span style="color: #66cc66;">&gt;</span>
&nbsp;
	<span style="color: #66cc66;">&lt;</span>mx:HBox<span style="color: #66cc66;">&gt;</span>
		<span style="color: #66cc66;">&lt;</span>mx:<span style="color: #0066CC;">Button</span> label=<span style="color: #ff0000;">&quot;Read Working Serializer&quot;</span> click=<span style="color: #ff0000;">&quot;readObj(true)&quot;</span> <span style="color: #66cc66;">/&gt;</span>
		<span style="color: #66cc66;">&lt;</span>mx:<span style="color: #0066CC;">Button</span> label=<span style="color: #ff0000;">&quot;Read Problem Serializer&quot;</span> click=<span style="color: #ff0000;">&quot;readObj()&quot;</span> <span style="color: #66cc66;">/&gt;</span>
	<span style="color: #66cc66;">&lt;/</span>mx:HBox<span style="color: #66cc66;">&gt;</span>
&nbsp;
	<span style="color: #66cc66;">&lt;</span>mx:Panel title=<span style="color: #ff0000;">&quot;Logging&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>mx:TextArea id=<span style="color: #ff0000;">&quot;logger&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> editable=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #0066CC;">wordWrap</span>=<span style="color: #ff0000;">&quot;true&quot;</span>
					 updateComplete=<span style="color: #ff0000;">&quot;logger.verticalScrollPosition=logger.maxVerticalScrollPosition&quot;</span> <span style="color: #66cc66;">/&gt;</span>
	<span style="color: #66cc66;">&lt;/</span>mx:Panel<span style="color: #66cc66;">&gt;</span>
&nbsp;
<span style="color: #66cc66;">&lt;/</span>mx:WindowedApplication<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>To test this out without having to compile it yourself, I've compiled it as an AIR installer: <a href='http://blog.smartlogicsolutions.com/wp-content/uploads/2008/08/serializationissue.air'>Serialization Issue AIR Application</a>.  And the source: <a href='http://blog.smartlogicsolutions.com/wp-content/uploads/2008/08/serializationissue.zip'>Serialization Issue Source</a>.</p>
<p>When I run the code below and click on the "Read Working Serializer" button I correctly see:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&#91;</span>WorkingSerializer<span style="color: #66cc66;">&#93;</span>
 arr: <span style="color: #66cc66;">&#91;</span> 
	<span style="color: #66cc66;">&#123;</span> obj: some, <span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #66cc66;">&#123;</span> obj: items, <span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #66cc66;">&#123;</span> obj: are, <span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #66cc66;">&#123;</span> obj: here, <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#93;</span></pre></div></div>

<p>get output to the console.  But, if I click on the "Read Problem Serializer" button I get the following RangeError:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">RangeError: <span style="color: #0066CC;">Error</span> <span style="color: #808080; font-style: italic;">#2006: The supplied index is out of bounds. </span>
at flash.<span style="color: #006600;">utils</span>::ByteArray<span style="color: #66cc66;">/</span>readObject<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> 
at io::ProblemSerializer<span style="color: #66cc66;">/</span>readExternal<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&lt;</span>path to environment<span style="color: #66cc66;">&gt;/</span>SerializationIssue<span style="color: #66cc66;">/</span>src<span style="color: #66cc66;">/</span>io<span style="color: #66cc66;">/</span>ProblemSerializer.<span style="color: #006600;">as</span>:<span style="color: #cc66cc;">19</span><span style="color: #66cc66;">&#93;</span> 
at flash.<span style="color: #006600;">filesystem</span>::FileStream<span style="color: #66cc66;">/</span>readObject<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> 
at SerializationIssue<span style="color: #66cc66;">/</span>readObj<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&lt;</span>path to environment<span style="color: #66cc66;">&gt;/</span>SerializationIssue<span style="color: #66cc66;">/</span>src<span style="color: #66cc66;">/</span>SerializationIssue.<span style="color: #006600;">mxml</span>:<span style="color: #cc66cc;">40</span><span style="color: #66cc66;">&#93;</span> 
at SerializationIssue<span style="color: #66cc66;">/</span>___SerializationIssue_Button2_click<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&lt;</span>path to environment<span style="color: #66cc66;">&gt;/</span>SerializationIssue<span style="color: #66cc66;">/</span>src<span style="color: #66cc66;">/</span>SerializationIssue.<span style="color: #006600;">mxml</span>:<span style="color: #cc66cc;">51</span><span style="color: #66cc66;">&#93;</span></pre></div></div>

<p>In the meantime I'll find a workaround for this, but has anyone encountered anything similar to this or know why this isn't working?</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><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><a href="http://blog.smartlogicsolutions.com/2008/07/11/losing-data-drag-and-drop-custom-class-flex-serialization/" rel="bookmark" class="crp_title">Losing Data When Drag and Dropping Custom Classes in Flex?</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/2009/05/28/flex-4-login-form-component/" rel="bookmark" class="crp_title">Flex 4 Login Form Component</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/08/16/recreating-elys-flex-4-list-component-series/" rel="bookmark" class="crp_title">Recreating Ely&#8217;s Flex 4 List Component Series</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/08/27/serialization-errorbug-when-using-bytearray-readobject-iexternalizable-class/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Losing Data When Drag and Dropping Custom Classes in Flex?</title>
		<link>http://blog.smartlogicsolutions.com/2008/07/11/losing-data-drag-and-drop-custom-class-flex-serialization/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/07/11/losing-data-drag-and-drop-custom-class-flex-serialization/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 05:13:51 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[Serialization]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2008/07/11/losing-data-drag-and-drop-custom-class-flex-serialization/</guid>
		<description><![CDATA[One of our developers recently encountered some strange behavior when he was dragging a piece of data (which was a custom class) from a TileList and dropping it into a List, but losing some pieces of the dragged data when it was dropped into the List. I discovered the root of the issue by delving [...]]]></description>
			<content:encoded><![CDATA[<p>One of our developers recently encountered some strange behavior when he was dragging a piece of data (which was a custom class) from a <code>TileList</code> and dropping it into a <code>List</code>, but losing some pieces of the dragged data when it was dropped into the <code>List</code>.  I discovered the root of the issue by delving into the source for the <code>dragDropHandler</code> function within <code>ListBase</code>&#8230;</p>
<p><span id="more-56"></span></p>
<p>the first clue was at line 9203 in the <code>mx.controls.listClasses.ListBase</code> class:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">collectionIterator.<span style="color: #0066CC;">insert</span><span style="color: #66cc66;">&#40;</span>copyItemWithUID<span style="color: #66cc66;">&#40;</span>items<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Ah ha, now on to see what <code>copyItemWithUID</code> does, so looking at line 9230:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> copyObj:<span style="color: #0066CC;">Object</span> = ObjectUtil.<span style="color: #0066CC;">copy</span><span style="color: #66cc66;">&#40;</span>item<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>and the trail ends in <code>mx.utils.ObjectUtil</code> at line 102 in the copy function:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> result:<span style="color: #0066CC;">Object</span> = buffer.<span style="color: #006600;">readObject</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<h3>The Problem and the Solution: Serialization</h3>
<p>Here I discovered the source of the problem.  The class that was being dragged was being properly serialized, but it had a property within it which was another custom class, and sure enough that class wasn&#8217;t being serialized.  This was causing that property to be lost &#8211; more specifically, it was becoming an empty Object.</p>
<p>If you don&#8217;t care how your class is serialized, but only that it will be properly serialized within Flex, then simply add the <code>[RemoteClass]</code> metadata tag above the class definition as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package com.<span style="color: #006600;">example</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
  <span style="color: #66cc66;">&#91;</span>RemoteClass<span style="color: #66cc66;">&#93;</span>
  <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MySerializableClass <span style="color: #66cc66;">&#123;</span>
    ...
  <span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/08/27/serialization-errorbug-when-using-bytearray-readobject-iexternalizable-class/" rel="bookmark" class="crp_title">Serialization Error/Bug When Using a ByteArray and readObject in an IExternalizable Class?</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><a href="http://blog.smartlogicsolutions.com/2008/11/17/migrairable-library-added-to-google-code/" rel="bookmark" class="crp_title">MigrAIRable Library Added to Google Code</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/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>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/11/losing-data-drag-and-drop-custom-class-flex-serialization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automating Flex Compilation Using ANT</title>
		<link>http://blog.smartlogicsolutions.com/2008/06/15/automating-flex-compilation-using-ant/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/06/15/automating-flex-compilation-using-ant/#comments</comments>
		<pubDate>Sun, 15 Jun 2008 07:04:56 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Greg Jastrab]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2008/06/15/automating-flex-compilation-using-ant/</guid>
		<description><![CDATA[When we first started developing Flex applications for clients when the time would come to send the SWF over, I would build the application in Flex Builder and send off the generated SWF. This got the job done, but it imposed a few limitations since I was the only Flex developer in our office: I [...]]]></description>
			<content:encoded><![CDATA[<p>When we first started developing Flex applications for clients when the time would come to send the SWF over, I would build the application in Flex Builder and send off the generated SWF.  This got the job done, but it imposed a few limitations since I was the only Flex developer in our office:</p>
<ul>
<li>I was the only one that knew how to compile the application</li>
<li>If someone else wanted to try to compile the application, they&#8217;d have to install Flex Builder</li>
</ul>
<p>After reading a <a href="http://www.rogue-development.com/blog2/2008/05/case-study-three-flex-applications/">blog post by Marc Hughes</a> I realized it was time we put in place a more versatile environment for building Flex applications.</p>
<p><span id="more-49"></span><br />
I settled on using <a href="http://ant.apache.org">ANT</a> since the Flex SDK includes a set of <a href="http://livedocs.adobe.com/flex/3/html/anttasks_1.html">ANT tasks</a> to simplify compiling using ANT.  I was quickly able to follow the examples to make an ANT script to compile a simple application:</p>
<h4>Simple Build File</h4>
<p>&lt;?xml version=&#8221;1.0&#8243;?&gt;<br />
&lt;project name=&#8221;TestANT&#8221; basedir=&#8221;.&#8221; default=&#8221;compile&#8221;&gt;</p>
<p>&nbsp;&nbsp;&lt;taskdef&nbsp;resource=&#8221;flexTasks.tasks&#8221;&nbsp;classpath=&#8221;${basedir}/flexTasks/lib/flexTasks.jar&#8221;&nbsp;/&gt;</p>
<p>&nbsp;&nbsp;&lt;property name=&#8221;FLEX_HOME&#8221; value=&#8221;/var/lib/flex&#8221; /&gt;</p>
<p>&nbsp;&nbsp;&lt;target name=&#8221;compile&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;mxmlc file=&#8221;TestANT.mxml&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;load-config filename=&#8221;${FLEX_HOME}/frameworks/flex-config.xml&#8221; /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;source-path path-element=&#8221;${FLEX_HOME}/frameworks&#8221; /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/mxmlc&gt;<br />
&nbsp;&nbsp;&lt;/target&gt;</p>
<p>&lt;/project&gt;</p>
<p>This works fine for a simple Flex project, but most projects we use utilize external libraries that have been compiled into a SWC.  Getting the Cairngorm SWC compiled into my test application by <a href="http://livedocs.adobe.com/flex/3/html/anttasks_5.html#207493">following the documentation</a> proved harder than it looked.  I first tried the following build file to compile a project using Cairngorm:</p>
<h4>Build File Attempting to Include Cairngorm</h4>
<p>&lt;?xml version=&#8221;1.0&#8243;?&gt;<br />
&lt;project name=&#8221;TestANT&#8221; basedir=&#8221;.&#8221; default=&#8221;compile&#8221;&gt;</p>
<p>&nbsp;&nbsp;&lt;taskdef&nbsp;resource=&#8221;flexTasks.tasks&#8221;&nbsp;classpath=&#8221;${basedir}/flexTasks/lib/flexTasks.jar&#8221;&nbsp;/&gt;</p>
<p>&nbsp;&nbsp;&lt;property name=&#8221;FLEX_HOME&#8221; value=&#8221;/var/lib/flex&#8221; /&gt;</p>
<p>&nbsp;&nbsp;&lt;target name=&#8221;compile&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;mxmlc file=&#8221;TestANT.mxml&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;load-config filename=&#8221;${FLEX_HOME}/frameworks/flex-config.xml&#8221; /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;source-path path-element=&#8221;${FLEX_HOME}/frameworks&#8221; /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;compiler.library-path dir=&#8221;${FLEX_HOME}/frameworks&#8221; append=&#8221;true&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;include name=&#8221;/var/lib/swcs/Cairngorm.swc&#8221; /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/compiler.library-path&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/mxmlc&gt;<br />
&nbsp;&nbsp;&lt;/target&gt;</p>
<p>&lt;/project&gt;</p>
<p>I thought I had followed the instructions properly, but unfortunately this was yielding:</p>
<p><code>[mxmlc] /home/greg/blah/test.mxml(6):  Error: Definition com.adobe.cairngorm.control:CairngormEvent could not be found.</code></p>
<p>After playing around with some parameters and re-reading the documentation a few times, i finally got it to include SWCs using the following code:</p>
<h4>Build File to Properly Include SWCs</h4>
<p>&lt;?xml version=&#8221;1.0&#8243;?&gt;<br />
&lt;project name=&#8221;TestANT&#8221; basedir=&#8221;.&#8221; default=&#8221;compile&#8221;&gt;</p>
<p>&nbsp;&nbsp;&lt;taskdef&nbsp;resource=&#8221;flexTasks.tasks&#8221;&nbsp;classpath=&#8221;${basedir}/flexTasks/lib/flexTasks.jar&#8221;&nbsp;/&gt;</p>
<p>&nbsp;&nbsp;&lt;property name=&#8221;FLEX_HOME&#8221; value=&#8221;/var/lib/flex&#8221; /&gt;<br />
&nbsp;&nbsp;&lt;property name=&#8221;LIBS&#8221; value=&#8221;/var/lib/swcs&#8221; /&gt;</p>
<p>&nbsp;&nbsp;&lt;target name=&#8221;compile&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;mxmlc file=&#8221;TestANT.mxml&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;load-config filename=&#8221;${FLEX_HOME}/frameworks/flex-config.xml&#8221; /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;source-path path-element=&#8221;${FLEX_HOME}/frameworks&#8221; /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;compiler.library-path dir=&#8221;${LIBS}&#8221; append=&#8221;true&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;include name=&#8221;Cairngorm.swc&#8221; /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/compiler.library-path&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/mxmlc&gt;<br />
&nbsp;&nbsp;&lt;/target&gt;</p>
<p>&lt;/project&gt;</p>
<p>The documentation is confusing since it says to specify the <code>${FLEX_HOME}/frameworks</code> directory as the <code>dir</code> attribute to the <code>&lt;compiler.library-path&gt;</code> tag.  I had thought my modification of their example would work, since I was assuming the <code>append</code> attribute was indicating to also include the paths in addition to the frameworks directory.  I guess that&#8217;s not the case, and by specifying the <code>&lt;compiler.library-path&gt;</code> parameter with <code>append="true"</code> included you are indicating to do the equivalent to <code>mxmlc -l+=somepath</code> on the command line.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/11/30/announcing-winners-of-free-tickets-for-intro-to-ruby-course/" rel="bookmark" class="crp_title">Announcing Winners of Free Tickets for Intro to Ruby Course</a></li><li><a href="http://blog.smartlogicsolutions.com/2009/11/23/web-2-0-expo-nyc-wrap-up/" rel="bookmark" class="crp_title">Web 2.0 Expo NYC Wrap Up</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/11/03/intro-to-ruby-on-rails-course-coming-to-baltimore/" rel="bookmark" class="crp_title">Intro to Ruby on Rails Course Coming to Baltimore</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/07/15/compiling-your-first-flex-4-application/" rel="bookmark" class="crp_title">Compiling Your First Flex 4 Application</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/07/16/skinning-button-flex-4-fxg/" rel="bookmark" class="crp_title">Skinning A Button in Flex 4 Using FXG</a></li><li>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/06/15/automating-flex-compilation-using-ant/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Flash Player 10 (&#8220;Astro&#8221;) Prerelease and Flex SDK Build Available to Compile Flash Player 10 Content</title>
		<link>http://blog.smartlogicsolutions.com/2008/05/16/flash-player-10-astro-flex-sdk-compile/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/05/16/flash-player-10-astro-flex-sdk-compile/#comments</comments>
		<pubDate>Fri, 16 May 2008 13:06:44 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Greg Jastrab]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2008/05/16/flash-player-10-astro-flex-sdk-compile/</guid>
		<description><![CDATA[Yesterday Adobe announced a prerelease version of Flasy Player 10 which is code-named &#8220;Astro&#8221;. Users may install it and ensure their existing Flash content continues to function in Flash Player 10. Some demos of Flash Player 10 content are available as well to see the new features in action. Some of the exciting new features [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday Adobe announced a prerelease version of <a href="http://labs.adobe.com/technologies/flashplayer10/">Flasy Player 10</a> which is code-named &#8220;Astro&#8221;.  Users may install it and ensure their existing Flash content continues to function in Flash Player 10.  Some <a href="http://labs.adobe.com/technologies/flashplayer10/demos/index.html">demos of Flash Player 10 content</a> are available as well to see the new features in action.</p>
<p>Some of the exciting new features include:</p>
<ol>
<li>the ability to render filters and effects made using the <a href="http://www.adobe.com/go/pixelbender_toolkit">PixelBender toolkit</a></li>
<li>dynamically manipulating sounds at the ByteArray level</li>
<li>new Vector class for strongly-typed, more efficient arrays</li>
<li>and plenty others</li>
</ol>
<p>For users that wish to start compiling their content into Flash Player 10 and taking advantage of things like <a href="http://www.senocular.com/flash/tutorials/flash10drawingapi/">the new Drawing API</a>, they may <a href="http://opensource.adobe.com/wiki/display/flexsdk/Targeting+Flash+Player+10+Beta+with+Flex+SDK+3.0.x">compile Flash Player 10 content</a> using a nightly build of the Flex 3 SDK.</p>
<p>Also, Aaron West <a href="http://www.trajiklyhip.com/blog/index.cfm/2008/5/15/Flash-Player-10-Link-Roundup">posted a great collection</a> of links to articles and blogs related to the release.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/05/21/flash-player-10-apis-astro/" rel="bookmark" class="crp_title">Flash Player 10 ActionScript Language Reference Posted on Labs</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/05/27/flash-player-10-peer-to-peer-faq/" rel="bookmark" class="crp_title">Flash Player 10 Peer-to-Peer FAQ</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/10/15/using-swfobject-to-seamlessly-upgrade-to-flash-player-10/" rel="bookmark" class="crp_title">Using SWFObject to Seamlessly Upgrade to Flash Player 10</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/05/06/flex4-opensource-gumbo-planning-documents/" rel="bookmark" class="crp_title">Flex 4 &#8220;Gumbo&#8221; Planning Documents</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/07/15/compiling-your-first-flex-4-application/" rel="bookmark" class="crp_title">Compiling Your First Flex 4 Application</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/05/16/flash-player-10-astro-flex-sdk-compile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex 4 &#8220;Gumbo&#8221; Planning Documents</title>
		<link>http://blog.smartlogicsolutions.com/2008/05/06/flex4-opensource-gumbo-planning-documents/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/05/06/flex4-opensource-gumbo-planning-documents/#comments</comments>
		<pubDate>Tue, 06 May 2008 14:26:01 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Greg Jastrab]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2008/05/06/flex4-opensource-gumbo-planning-documents/</guid>
		<description><![CDATA[Since Adobe has opensourced the Flex SDK, the planning stages of Flex 4 (codenamed &#8220;Gumbo&#8221;) are being publicly documented. I&#8217;ve been watching this page since it went up on Adobe&#8217;s Open Source site and just noticed a change last night. A working document has been added to describe the states syntax changes that are currently [...]]]></description>
			<content:encoded><![CDATA[<p>Since Adobe has opensourced the Flex SDK, the <a href="http://opensource.adobe.com/wiki/display/flexsdk/Flex+4">planning stages of Flex 4</a> (codenamed &#8220;Gumbo&#8221;) are being publicly documented.  I&#8217;ve been watching this page since it went up on <a href="http://opensource.adobe.com">Adobe&#8217;s Open Source</a> site and just noticed a change last night.</p>
<p>A working document has been added to describe the <a href="http://opensource.adobe.com/wiki/display/flexsdk/Enhanced+States+Syntax">states syntax changes</a> that are currently being drafted.  The syntax changes document contains a few examples of how the code would differ from using states in Flex 2/3 and in Flex 4.  Some of the new <a href="http://clintm.esria.com/2008/02/26/mxml-g-an-xml-abstraction-of-the-flash-player-drawing-api-and-then-some/">MXML-G</a> tags can be seen in the <a href="http://opensource.adobe.com/wiki/display/flexsdk/Enhanced+States+Syntax#EnhancedStatesSyntax-Flex4ButtonSkin">examples</a>.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><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/10/21/advanced-css-in-flex-4-id-and-descendant-selectors/" rel="bookmark" class="crp_title">Advanced CSS in Flex 4 &#8211; ID and Descendant Selectors</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/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/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/10/08/new-flex-4-theme-and-class-renaming/" rel="bookmark" class="crp_title">New Flex 4 Theme and Class Renaming</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/05/06/flex4-opensource-gumbo-planning-documents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

