<?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; AS3</title>
	<atom:link href="http://blog.smartlogicsolutions.com/category/as3/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>PureMVCGen 0.1.1 Released &#8211; Now Works on Windows</title>
		<link>http://blog.smartlogicsolutions.com/2008/12/18/puremvcgen-011-released-now-works-on-windows/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/12/18/puremvcgen-011-released-now-works-on-windows/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 22:47:49 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[PureMVC]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[generator]]></category>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2008/05/21/flash-player-10-apis-astro/</guid>
		<description><![CDATA[If you want to learn the syntax and usages of the APIs in Flash Player 10 (&#8220;Astro&#8221;) they can be downloaded from labs. You can check out the Flash Player 10 page on Adobe Labs to learn how to compile content to target Flash 10 or check out my previous post. Related Posts:Flash Player 10 [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to learn the syntax and usages of the APIs in Flash Player 10 (&#8220;Astro&#8221;) they can be <a href="http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_as3langref_052008.zip">downloaded from labs</a>.</p>
<p>You can check out the <a href="http://labs.adobe.com/technologies/flashplayer10/">Flash Player 10 page</a> on <a href="http://labs.adobe.com">Adobe Labs</a> to learn how to compile content to target Flash 10 or check out <a href="http://blog.smartlogicsolutions.com/2008/05/16/flash-player-10-astro-flex-sdk-compile/">my previous post</a>.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><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/09/25/rotate-effect-and-non-embedded-fonts-in-flex-4/" rel="bookmark" class="crp_title">Rotate Effect and Non Embedded Fonts in Flex 4</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/10/08/new-flex-4-theme-and-class-renaming/" rel="bookmark" class="crp_title">New Flex 4 Theme and Class Renaming</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/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/05/27/flash-player-10-peer-to-peer-faq/" rel="bookmark" class="crp_title">Flash Player 10 Peer-to-Peer FAQ</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/21/flash-player-10-apis-astro/feed/</wfw:commentRss>
		<slash:comments>0</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 MVC Component Architecture Using OpenFlux</title>
		<link>http://blog.smartlogicsolutions.com/2008/04/05/openflux-flex-mvc-component/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/04/05/openflux-flex-mvc-component/#comments</comments>
		<pubDate>Sat, 05 Apr 2008 18:27:15 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[OpenFlux]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2008/04/05/openflux-flex-mvc-component/</guid>
		<description><![CDATA[OpenFlux is an MVC (Model-view-controller) framework for developing Flex components. Ben Stucki created the project after being inspired by a presentation Ely Greenfield gave at MAX Barcelona. Videos of the Flex Roadmap session (courtesy of JoÃ£o Fernandes) are well worth the watch. If you&#8217;re interested in playing with (or just learning more about) OpenFlux head [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://openflux.googlecode.com">OpenFlux</a> is an <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC</a> (Model-view-controller) framework for developing Flex components.</p>
<p><a href="http://blog.benstucki.net">Ben Stucki</a> created the project after being inspired by a presentation <a href="http://www.quietlyscheming.com/blog">Ely Greenfield</a> gave at MAX Barcelona.</p>
<p><a href="http://www.onflexwithcf.org/index.cfm/2007/10/19/Flex-Roadmap-presented-by-Ely-Greenfield--Videos">Videos of the Flex Roadmap</a> session (courtesy of <a href="http://www.onflexwithcf.org/">JoÃ£o Fernandes</a>) are well worth the watch.</p>
<p>If you&#8217;re interested in playing with (or just learning more about) <a href="http://openflux.googlecode.com">OpenFlux</a> head on over and <a href="http://code.google.com/p/openflux/source/checkout">check out the source</a>.  I just added a wiki page explaining <a href="http://code.google.com/p/openflux/wiki/CompileOpenFluxSWC">how to compile OpenFlux into a SWC</a> if you need help getting started.</p>
<p>Happy Fluxing!</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/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/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/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/2008/11/12/presenting-an-intro-to-flex-at-refresh-baltimore-tonight/" rel="bookmark" class="crp_title">Presenting an Intro to Flex at Refresh Baltimore Tonight</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/04/05/openflux-flex-mvc-component/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe onAIR Bus Tour: Baltimore</title>
		<link>http://blog.smartlogicsolutions.com/2007/08/21/adobe-onair-bus-tour-baltimore/</link>
		<comments>http://blog.smartlogicsolutions.com/2007/08/21/adobe-onair-bus-tour-baltimore/#comments</comments>
		<pubDate>Wed, 22 Aug 2007 04:40:48 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Yair Flicker]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2007/08/21/adobe-onair-bus-tour-baltimore/</guid>
		<description><![CDATA[Yair and I went to the Baltimore stop of Adobe&#8217;s onAIR Bus Tour tonight. Ryan Stewart Ryan Stewart kicked off the keynote giving an introduction and overview to Adobe AIR. After briefly going over the background/web-history of the Flash player and the motivations behind the development of Adobe AIR, Ryan showcased some AIR applications: Finetune [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.smartlogicsolutions.com/wiki/Yair_Flicker">Yair</a> and <a href="http://www.smartlogicsolutions.com/wiki/Greg_Jastrab">I</a> went to the Baltimore stop of Adobe&#8217;s <a href="http://onair.adobe.com">onAIR Bus Tour</a> tonight.</p>
<h4>Ryan Stewart</h4>
<p>Ryan Stewart kicked off the keynote giving an introduction and overview to Adobe AIR.  After briefly going over the background/web-history of the Flash player and the motivations behind the development of Adobe AIR, Ryan showcased some AIR applications:</p>
<ul>
<li><a href="http://www.finetune.com/">Finetune</a></li>
<li>A task app that was made in 24 hours w/ straight CSS &#038; JavaScript by the creator of the Ext framework</li>
<li><a href="http://www.virtub.com/">Buzzword</a></li>
<li><a href="http://labs.adobe.com/wiki/index.php/Media_Player">Adobe Media Player</a> (not publicly released yet)</li>
</ul>
<p>He also highlighted that with the newly <a href="http://labs.adobe.com/technologies/flashplayer9/">announced update</a> to Flash Player  9 (codenamed &#8220;Moviestar&#8221;), Flash SWFs will be able to support H.264 video and HE-AAC audio.  This will allow Quicktime movies to be played through SWFs and the Adobe Media Player.</p>
<p>Ryan then mentioned that the second public beta drop of AIR will be released during the <a href="http://www.adobe.com/go/max">MAX 2007</a> conference.  Also, we were reminded of the <a href="http://www.adobe.com/go/airderby">AIR Developer Derby</a>: a contest to see who can make the <i>best</i> AIR application.  The grand prize is essentially a $100,000 travel coupon.  There will also be five category winners that will win &#8220;The Ultimate Desktop Environment&#8221;, which is pretty much a bunch of beast hardware.</p>
<h4>Mike Chambers</h4>
<p>Next up was <a href="http://www.mikechambers.com/blog/">Mike Chambers</a> demo&#8217;ing how to write a HelloWorld Flex-based AIR application.  Pretty standard, but he went on to highlight the install experience for end-users that will be using AIR applications we developers will be creating.  End-users will need the AIR runtime in order to install an AIR app, but developers will be able to place a Flash Badge on their website which will allow users without the AIR runtime to install both the runtime and their AIR application with only 4 clicks.</p>
<p>Mike finished off with pointing any developers that are starting to play around with AIR to the <a href="http://onair.adobe.com/api/"> onAIR Bus APIs</a> which have a ton of live data that can be used in an AIR app.</p>
<h4>Kevin Hoyt</h4>
<p><a href="http://blog.kevinhoyt.org">Kevin Hoyt</a> was next to demo how to build an HTML-based AIR Application.</p>
<p>Kevin emphasized that Flex Builder is not necessary to create AIR applications.  The Flex 3 SDK (which is freely downloadable) contains the AIR SDK as well, so you can compile and debug your AIR applications from the command line.  Dreamweaver CS3 also has an AIR extension so if you&#8217;re a web developer that&#8217;s afraid of the command line you can go ahead and develop your HTML page in Dreamweaver and debug the application or package it as an AIR file directly within the comfort of Dreamweaver.</p>
<h5>Script Bridging</h5>
<p>Kevin next demo&#8217;d the script bridging capabilities of AIR, which lets JavaScript reach into the ActionScript world and invoke any methods in the Flash API (anything in the flash.* namespace).  The reverse is also true (ActionScript reaching into the JavaScript world).  This means you can have a purely HTML-based AIR application that can call methods in the Flash API by simply doing things like:</p>
<pre><code>&lt;script&gt;
  var airFile = window.runtime.flash.filesystem.File;
  var desktop = airFile.desktopDirectory;
  var myFileInJS = new airFile(desktop.resolve("file_on_the_desktop.txt");
&lt;/script&gt;
</code></pre>
<p>Here, <code>myFileInJS</code> is a JavaScript variable that references an ActionScript 3 class from the AIR SDK.</p>
<p>So &#8220;window.runtime.flash.* can let you directly use any Flash class from JavaScript. IMO the coolest thing Kevin covered is the ability augment the Flash packages you can use by simply script including a library.swf from any SWC to access those AS classes:</p>
<pre><code>&lt;script src="library.swf"&gt;&lt;/script&gt;
&lt;script&gt;
  var encoder = runtime.com.adobe.images.PNGEncoder;
  encoder.encode( bitmapData )
&lt;/script&gt;
</code></pre>
<p>In this example, <code>encoder</code> is the PNGEncoder from the <a href="http://code.google.com/p/as3corelib/">as3corelib</a> project, but the encoding is being done in JavaScript using AS classes!  Very cool stuff.  (FYI: a SWC is stored in a ZIP format, so you can just unzip a SWC file to access the library.swf inside of it)</p>
<h4>Chafic Kazoun: Windowing in AIR</h4>
<p>Windowing concepts <a href="http://www.rewindlife.com/">Chafic</a> covered/demo&#8217;d:</p>
<ul>
<li>utility window</li>
<li>standard window</li>
<li>custom chrome transparent window</li>
<li>custom chrome where background is embedded in a SWF</li>
<li>custom window dispatching events and being listened to by another window</li>
</ul>
<h4>Ben Forta: AIR + ColdFusion</h4>
<p>Highlights from Ben&#8217;s talk:</p>
<ul>
<li>50% of existing ColdFusion customers have upgraded to ColdFusion 8.</li>
<li>ColdFusion/Flex Extensions for Eclipse available at Adobe&#8217;s ColdFusion page.</li>
</ul>
<p>Can generate a ColdFusion-backed Flex web app w/ literally no front-end coding; the extension has Master/Detail/Master_Detail and DB wizards to configure everything which then generates the CFCs, MXML components, and CSS stylesheets using all best practices.</p>
<p>This was possible before in ColdFusion 7, but now ColdFusion 8 can generate a ColdFusion-backed AJAX/HTML/CSS web app in the same manner.</p>
<p>From AIR you can load an HTML page from a ColdFusion backend and it will properly renders this AJAX/HTML/CSS generated content.</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/03/31/air-linux-adobe-alpha-flexbuilder/" rel="bookmark" class="crp_title">Adobe AIR Alpha Released on Linux</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/02/25/flex-air-released-adobe/" rel="bookmark" class="crp_title">AIR 1.0 and Flex 3 Released</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/09/11/migrating-serialization-changes-within-an-air-application/" rel="bookmark" class="crp_title">Migrating Serialization Changes Within an AIR Application</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/11/17/migrairable-library-added-to-google-code/" rel="bookmark" class="crp_title">MigrAIRable Library Added to Google Code</a></li><li>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/2007/08/21/adobe-onair-bus-tour-baltimore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Certified Adobe Flex 2 Developer</title>
		<link>http://blog.smartlogicsolutions.com/2007/05/20/certified-adobe-flex-2-developer/</link>
		<comments>http://blog.smartlogicsolutions.com/2007/05/20/certified-adobe-flex-2-developer/#comments</comments>
		<pubDate>Sun, 20 May 2007 22:30:23 +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/2007/05/20/certified-adobe-flex-2-developer/</guid>
		<description><![CDATA[Yesterday I became certified as an Adobe Flex 2 Developer. It was easy to locate and schedule taking the test through Thomson Prometric. The studying materials I used to prepare were: Flex 2 Developer&#8217;s Guide Creating and Extending Flex 2 Components Building and Deploying Flex 2 Applications I had already begun programming in ActionScript 3.0 [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://blog.smartlogicsolutions.com/wp-content/uploads/2007/05/acp_flex_developer.gif' alt='Certified Flex 2 Developer' /></p>
<p>Yesterday I became certified as an Adobe Flex 2 Developer.  It was easy to locate and schedule taking the test through <a href="http://www.prometric.com">Thomson Prometric</a>.</p>
<p>The studying materials I used to prepare were:</p>
<ul>
<li><a href="http://www.adobe.com/go/flex2_devapps_pdf">Flex 2 Developer&#8217;s Guide</a></li>
<li><a href="http://www.adobe.com/go/flex2_components_pdf">Creating and Extending Flex 2 Components</a></li>
<li><a href="http://www.adobe.com/go/flex2_building_pdf">Building and Deploying Flex 2 Applications</a></li>
</ul>
<p>I had already begun programming in ActionScript 3.0 prior to learning Flex 2, but for those new to ActionScript 3.0 the <a href="http://www.adobe.com/go/programmingAS3_pdf">Programming ActionScript 3.0</a> documentation will get you up to speed.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><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/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/07/16/skinning-button-flex-4-fxg/" rel="bookmark" class="crp_title">Skinning A Button in Flex 4 Using FXG</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/05/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/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/2007/05/20/certified-adobe-flex-2-developer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

