<?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>dispatchEvent()™ &#187; Flex</title>
	<atom:link href="http://dispatchevent.org/category/flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://dispatchevent.org</link>
	<description>Collective thoughts on the Flash Platform, iOS, Unity, and any other technology we use.</description>
	<lastBuildDate>Mon, 23 Apr 2012 19:07:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Don&#8217;t Panic.</title>
		<link>http://dispatchevent.org/mims/dont-panic/</link>
		<comments>http://dispatchevent.org/mims/dont-panic/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 22:45:38 +0000</pubDate>
		<dc:creator>Mims H Wright</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[IRL]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://dispatchevent.org/?p=900</guid>
		<description><![CDATA[Dear Flash &#38; Flex Interactive Developers, keep calm and carry on. The news from Adobe seems like a big deal now but I&#8217;m not sure that it&#8217;s soon enough to judge what the long term impact will be. In my opinion, it&#8217;s not yet time to panic (is it ever?) and in this post, I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>Dear <strike>Flash &amp; Flex</strike> Interactive Developers, keep calm and carry on. The news from Adobe seems like a big deal now but I&#8217;m not sure that it&#8217;s soon enough to judge what the long term impact will be. In my opinion, it&#8217;s not yet time to panic (is it ever?) and in this post, I&#8217;ll talk about why.  </p>
<p>First, if you don&#8217;t know what I&#8217;m talking about, check out the news. I think the best explanation comes from <a href="http://www.mikechambers.com/blog/2011/11/11/clarifications-on-flash-player-for-mobile-browsers-the-flash-platform-and-the-future-of-flash/">Mike Chambers&#8217; Blog</a> and a corresponding post on the <a href="http://blogs.adobe.com/flex/2011/11/your-questions-about-flex.html">Flex Team&#8217;s Blog</a>. </p>
<div id="attachment_901" class="wp-caption alignnone" style="width: 310px"><a href="http://dispatchevent.org/wp-content/uploads/2011/11/cute_bunny.jpeg"><img src="http://dispatchevent.org/wp-content/uploads/2011/11/cute_bunny-300x207.jpg" alt="" title="cute_bunny" width="300" height="207" class="size-medium wp-image-901" /></a><p class="wp-caption-text">Don&#039;t panic! Take a deep breath and look at this cute bunny</p></div>
<p><span id="more-900"></span></p>
<h2>Not much has changed with the Flash Platform</h2>
<p>If you read closely, not that much has really changed. The problem is perception. Let&#8217;s review what is going away and why it&#8217;s not as crazy as it might sound. </p>
<h3>Mobile Flash Player</h3>
<p>Adobe is discontinuing work on the mobile Flash Player. I don&#8217;t know the numbers of people building Flash content for Android but I suspect it&#8217;s not incredibly high. I would also wager that even Air on Android/iOS is still far from critical mass, but Adobe say they will continue to support this. The desktop Flash Player will stay the same and for the foreseeable future continue to surpass HTML5 in features and cross-platform functionality. </p>
<p>Another way of saying this is that the Flash Platform remains the best choice for the tasks that it was already the best choice for. Mobile was never one of these and some applications, like video players, may have lost that title to HTML5. But in cross-platform, rich-media, deeply interactive experiences on the web, Flash is still ahead of the competition.  </p>
<h3>Flex is still here</h3>
<p>Adobe is discontinuing its support for the Flex SDK. However, it will stay around as <a href="http://spoon.as">an open source project</a> (it was already open source.) It may never get better than it is already, which so far has been good enough to become the platform of choice for many Flex developers.  </p>
<p>Flex cannot get any worse than the next version 4.6, which you were probably looking forward to until today. And you know what, that&#8217;s okay. We don&#8217;t need to be so obsessed with the next thing that we change careers because the <em>next</em> next thing has an uncertain future. I happen to know of some projects that are still using Flex 3 and will probably never upgrade. Why? The user doesn&#8217;t know the difference between <code>mx</code> and <code>spark</code> skins. </p>
<p>It may also get better after being untethered from Adobe and in hands of the Flex Community. In other words, we&#8217;re in charge now. The <a href="http://www.spoon.as/core-values/">Spoon</a> community, who is inheriting the Flex project, already have plans to make a version 5.x.</p>
<h2>Fear itself</h2>
<p>The real issue now is the way the public will preceive this news. This announcement has sapped the confidence of a lot of people, customers and developers alike. In my opinion, it&#8217;s not the time for us to decry Adobe as evil jerks. It is a time for us as experts to try to help our clients, companies and the public to make sense of the news. It&#8217;s time to remember that Flash is just a tool in the arsenal of an interactive developer. In fact, Flash&#8217;s popularity, due to <a href="http://www.apple.com/hotnews/thoughts-on-flash/">largely political reasons</a>, has already been on the decline for a while now. But, it will certainly be dead if the Flash users themselves don&#8217;t believe in it. </p>
<p>The next time a client wants an awesome, interactive video, 3D puzzle game, website thing I will still recommend Flash. I don&#8217;t want to have him tell me &#8220;it has to be HTML5&#8243; because he read online that &#8220;Flash is dead.&#8221; In fact, I think it&#8217;s our job to talk about its strengths and its weaknesses in a totally objective way. We should all dwell in the middle ground between Adobe zealotry and jumping on the next bandwagon. </p>
<h3>Your next job</h3>
<p>I feel hopeful that the shit will not hit the fan, at least not immediately. That being said, I am always an advocate of looking at other technologies and keeping those abstract coding skills honed. Good developers are in a prime position to port our skills to whatever platform comes next, and those skills are almost always in demand. Even HTML5 (JavaScript) apps share a very similar language with AS3 (really AS1). I was able to pick up JQuery and build my first HTML5 project in a matter of a day or two. </p>
<p>As Mike Chamber&#8217;s writes:<br />
<block>&#8220;I think it is a HUGE opportunity for the Flash community. As browser support for richer content and motion graphics improves, so will demand for designers and developers who have experience working with motion graphics on the web. The Flash community has been doing this type of work on the web for over a decade and is uniquely qualified to fill demand for similar work in the browser. I donâ€™t think it is a coincidence that some of the most cutting edge motion graphics work being done in HTML5 today is being done by developers and agencies with extensive experience in Flash (such as Grant Skinner, Branden Hall, Big Spaceship, etcâ€¦).&#8221;</block></p>
<p>Joel Hooks adds some great notes on this in <a href="http://thoughts.joelhooks.com/post/12680058831/you-are-not-your-platform-here-are-some-things-you#/">his blog post</a>. I&#8217;d like to also add <a href="http://haxe.org/">HAXE</a>, Java, C# and <a href="http://www.dartlang.org/">Dart</a> to the list of languages that you should be able to pick up with little effort. </p>
<h3>The Community</h3>
<p>In LA, our local Flex group shut down abruptly after this news was released. I personally feel this was very hasty indeed and wrote a letter about it upon which this blog post was based. I see that a lot of people are really pissed and their identities are in question. If you&#8217;re in this position, I would suggest instead of jumping ship, why not continue to talk about how this will impact our jobs and what skills we can port to other platforms. If there really are people out there who are going to lose their jobs over this, and I think it&#8217;s too soon to say, we should still be able to support each other as a community. </p>
<p>Even with all this positivity, I still have to agree with <a href="http://twitter.com/#!/neurofuzzy/status/135442238607081472">@neurofuzzy</a> &#8220;Anyone who has &#8216;Flash&#8217; in your job title, scratch it out and write &#8216;Interactive.&#8217;&#8221; It&#8217;s something we should have all done a long time ago because I believe we are more than just Flash dudes. </p>
<p><em>I&#8217;d love to hear your thoughts on all of this. Please leave comments. It will be very interesting to look back on this post in 6 months and see whether I was right to keep a cool head or being terribly naÃ¯ve.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://dispatchevent.org/mims/dont-panic/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Using %tokens% with Flex resource bundles</title>
		<link>http://dispatchevent.org/mims/using-tokens-with-flex-resource-bundles/</link>
		<comments>http://dispatchevent.org/mims/using-tokens-with-flex-resource-bundles/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 19:26:08 +0000</pubDate>
		<dc:creator>Mims H Wright</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tips, Tricks, and Hacks]]></category>
		<category><![CDATA[resource bundles]]></category>
		<category><![CDATA[strings]]></category>
		<category><![CDATA[token]]></category>

		<guid isPermaLink="false">http://dispatchevent.org/?p=796</guid>
		<description><![CDATA[When I use Flex, I make extensive use of Resource Bundles for all but the most basic applications. In short, they allow you to keep all of your static string values (and non-string values) separated out of your code. That way, down the line it&#8217;s a very easy change when you want to localize the [...]]]></description>
			<content:encoded><![CDATA[<p>When I use Flex, I make extensive use of <a href="http://help.adobe.com/en_US/Flex/4.0/UsingSDK/WS2db454920e96a9e51e63e3d11c0bf69084-7fcf.html">Resource Bundles</a> for all but the most basic applications. In short, they allow you to keep all of your static string values (and non-string values) separated out of your code. That way, down the line it&#8217;s a very easy change when you want to localize the site in another language, rebrand it for another audience, or when a client asks you to change a button label or error message. Granted, this level of detail isn&#8217;t always necessary but I think it&#8217;s a good habit to get into even if it&#8217;s overkill for some projects.</p>
<p>But resource bundles can&#8217;t help you in every scenario. I often find myself needing to construct a sentence with live data inserted. For this, the resource strings are less helpful. For example, how would you write:</p>
<p><code>"At " + time + ", you received a message from " + userName + "."</code></p>
<p>With resource strings, you would have to do something like</p>
<pre>at=At
message=, you received a message from
period=.</pre>
<p>Which completely negates the whole point of using resource bundles. What to do?</p>
<h3>Token replacement</h3>
<p><img class="size-full wp-image-799 alignright" title="tokens" src="http://dispatchevent.org/wp-content/uploads/2009/12/tokens.jpg" alt="tokens" width="155" height="125" /><br />
What I really wanted was a way to inject data into the string. I&#8217;ve seen this done by use of tokens in other languages like <a href="http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Strings/Articles/FormatStrings.html#//apple_ref/doc/uid/20000943">Objective-C</a> so I thought I&#8217;d give it a try. The result was surprisingly lightweight.</p>
<p>I created this utility that lets you use tokens (delimited by % signs) that can be replaced by live data when you retrieve the resource. Using this class, the example above would look more like this:</p>
<pre>receivedMessage=At %time%, you received a message from %userName%.

// then in your code
trace(ResourceStringUtil.getResoureceStringWithTokens("receivedMessage", {time: "11:49", userName: "Mims"}));

// displays
At 11:49, you received a message from Mims.</pre>
<p>Here&#8217;s the source code Feel free to use it and modify it for your purposes.</p>
<p><script src="http://gist.github.com/251904.js?file=ResourceStringUtil.as"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://dispatchevent.org/mims/using-tokens-with-flex-resource-bundles/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using ant for Flex &#8211; a no B.S. guide &#8211; Part 4 of 4</title>
		<link>http://dispatchevent.org/mims/ant-for-flex-part-4/</link>
		<comments>http://dispatchevent.org/mims/ant-for-flex-part-4/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 03:31:43 +0000</pubDate>
		<dc:creator>Mims H Wright</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tips, Tricks, and Hacks]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[flashbuilder]]></category>
		<category><![CDATA[flexbilder]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://dispatchevent.org/?p=771</guid>
		<description><![CDATA[Part 1 Part 2 Part 3 Part 4 Now that you&#8217;ve been through 3 exhaustive tutorials on ant for flex, it&#8217;s time to use your knowledge you&#8217;ve gained to turn your back on the built-in Flex compiler and switch to ant for your builds. This part applies to FlexBuilder (and FlashBuilder) users only although it [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://dispatchevent.org/mims/ant-for-flex-part-1/">Part 1</a></li>
<li><a href="http://dispatchevent.org/mims/ant-for-flex-part-2/">Part 2</a></li>
<li><a href="http://dispatchevent.org/mims/ant-for-flex-part-3/">Part 3</a></li>
<li>Part 4</li>
</ul>
<p>Now that you&#8217;ve been through 3 exhaustive tutorials on ant for flex, it&#8217;s time to use your knowledge you&#8217;ve gained to turn your back on the built-in Flex compiler and switch to ant for your builds. This part applies to FlexBuilder (and FlashBuilder) users only although it may apply if you&#8217;re using some other eclipse-based plugin. If you&#8217;re using another program like TextMate or Flash CSx, you can skip this article.<br />
<span id="more-771"></span></p>
<h3>Replacing the default builder with your ant tasks</h3>
<p>The rest of this article will show you how to use your ant build script to perform the building actions found in FlashBuilder.</p>
<p>In FlashBuilder, the following building actions can be executed</p>
<ul>
<li><strong>Build Project &#8211; </strong>Occurs when the user manually builds the project.</li>
<li><strong>Build Automatically &#8211; </strong>When the option is checked in the Project menu, the code is automatically build when you save a file. Usually incrementally.</li>
<li><strong>Clean</strong> &#8211; &#8216;cleans&#8217; the project folder by doing a complete, non-incremental build and removing temporary files.</li>
</ul>
<p>These actions are all called by various actions and handled by one or more <em>builders</em>. In terms of the eclipse SDK, a builder is an XML file that describes how the various build actions will be executed. In FlashBuilder, all of these are set up to use the Flex &#8220;builder&#8221; by default. You can add new customized builders to supplement these build actions. You can also deactivate the default builder an just use your ant builds instead <strong>but you will lose the ability to see inline errors in your code</strong>.</p>
<p>In order for this to work however, you need to start out with some solid, well-tested ant tasks.</p>
<h4>Step 1 &#8211; Create the appropriate ant targets</h4>
<p>Create a target in your build.xml for each of the actions listed above. Call each target &#8220;build&#8221;, &#8220;autoBuild&#8221;, and &#8220;clean&#8221;. You can probably start with the &#8220;build&#8221; target and reuse it for the other two. To write an incremental build target (used for the build-automatically action) there is an example in<a href="http://dispatchevent.org/mims/ant-for-flex-part-2/"> Part 2</a> of this article.</p>
<p>Before moving on, please test your build script thoroughly to be sure there are no errors and that your files are compiling correctly.</p>
<p>Note, I&#8217;m not going to go into the details here about exactly how to write your ant script. If you&#8217;re considering switching to ant as your primary builder then A) your project has special needs that need to be addressed by a custom build script and I don&#8217;t know what those needs are and B) you need to know what you&#8217;re doing with ant before completely abandoning FlashBuilder&#8217;s defaults. I will say, save the fancy stuff for your release build targets and do incremental builds by default since you&#8217;ll be running these scripts quite a lot.</p>
<h4>Step 2 &#8211; Create a builder for your ant build script</h4>
<ol>
<li>Open the properties for the project you want to edit. <strong>Project -&gt; Properties</strong></li>
<li><strong>Select the Builders item</strong> in the left menu. You will see that the default builder &#8220;Flex&#8221; is already set up.</li>
<li><strong>Click the New&#8230; button</strong>. A dialog will come up with templates for the new builder.</li>
<li><strong>Choose the &#8220;Program&#8221; type</strong>. (On my configuration, I see an option for &#8220;Ant Builder&#8221; also which is what I should probably be using, however, I haven&#8217;t gotten it to work yet and it doesn&#8217;t seem to generate any specific errors when it fails so I gave up and went with Program. If you know how to fix this, let me know!)</li>
<li><strong>Name the builder &#8220;flexAntBuilder&#8221;</strong></li>
<li><strong>Set the location field to the ant binary you&#8217;re using.</strong> If you&#8217;re not sure where the binary is located, you can use the command <code>which ant</code> in the command line. Mine is at <code>/usr/bin/ant</code></li>
<li><strong>Set the Working directory to your project&#8217;s home directory</strong>. If you&#8217;re not sure, browse to it.</li>
<li><strong>In the arguments field, enter the name of the target you want to run. </strong>In this case <code>build</code>.</li>
<li><strong>Optional: Click on the Refresh tab.</strong> Here you can chose whether to refresh the files in your workspace when the build completes.</li>
<li><strong>Click on the Build Options tab. </strong>Here, under the &#8220;Run the Builder:&#8221; heading near the bottom, is where you&#8217;re going to set the properties that determine when this particular task is run. For the &#8216;build&#8217; target, <strong>uncheck everything except &#8220;During Manual Builds&#8221;.</strong>
<ul>
<li>For your &#8220;autoBuild&#8221; target, you&#8217;re going to uncheck everything except &#8220;During auto builds&#8221;</li>
<li>For your &#8220;clean&#8221; target, you&#8217;re going to uncheck everything except &#8220;After a clean&#8221;</li>
</ul>
</li>
<li><strong>Repeat steps 1-10 for the other two targets.</strong></li>
<li>When all targets are added,<strong> </strong><strong>optionally</strong><strong> uncheck the &#8220;flex&#8221; builder from the builders menu in your project properties to use the ant tasks exclusively.</strong> Now your ant scripts will be used instead of the flex builder.</li>
</ol>
<p>That&#8217;s it! Be sure to test things and make sure you&#8217;re not getting any errors.</p>
<h4>What to expect from here</h4>
<p>So you&#8217;ve unchained yourself from the system and are using your ant scripts to build your project. Congratulations, you&#8217;re a huge nerd! From this point on, changing the compile settings in the Project Properties dialog (like the build path) may be ineffective. You&#8217;ll need to make changes to your build path in the ant file.</p>
<p>The results from your builds will appear in the Console view. Here you can see the progress of builds and check for errors in the code. As I mentioned before, if you deactivate the flex builder you won&#8217;t get inline errors in your code any longer.</p>
<p>Finally, adding the new builders will create a new invisible folder in your project&#8217;s root folder called .externalToolBuilders where your builder definitions will be kept. You don&#8217;t need to do anything with this folder, but be aware that it&#8217;s there.</p>
<p>That concludes this 4 part epic post about ant tasks for flex! I hope you found it useful. If you have anything to add, please post comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://dispatchevent.org/mims/ant-for-flex-part-4/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using ant for Flex &#8211; a no B.S. guide &#8211; Part 3 of 4</title>
		<link>http://dispatchevent.org/mims/ant-for-flex-part-3/</link>
		<comments>http://dispatchevent.org/mims/ant-for-flex-part-3/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 01:31:16 +0000</pubDate>
		<dc:creator>Mims H Wright</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tips, Tricks, and Hacks]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[flexbuilder]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://dispatchevent.org/?p=763</guid>
		<description><![CDATA[Part 1 Part 2 Part 3 Part 4 This third installment talks about tips and tricks for using ant with version control systems. Defining external properties for each user Since not everyone&#8217;s machine is the same and letting everyone build a project is a major reason to use ant, it&#8217;s good to avoid hard coding [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://dispatchevent.org/mims/ant-for-flex-part-1/">Part 1</a></li>
<li><a href="http://dispatchevent.org/mims/ant-for-flex-part-2/">Part 2</a></li>
<li>Part 3</li>
<li><a href="http://dispatchevent.org/mims/ant-for-flex-part-4/">Part 4</a></li>
</ul>
<p>This third installment talks about tips and tricks for using ant with version control systems.<br />
<span id="more-763"></span></p>
<h3>Defining external properties for each user</h3>
<p>Since not everyone&#8217;s machine is the same and letting everyone build a project is a major reason to use ant, it&#8217;s good to avoid hard coding paths to files within your build.xml file. As such, I use a lot of &lt;property&gt; tags to set up paths and such. But you also don&#8217;t want to have several people constantly editing your build.xml because it could get broken or out of sync. Oh no! What do we do!?</p>
<p>Luckily, ant lets you define a set of properties in an external file. This is a simple text file containing name=value pairs and commented using #. By default, the recommended filename is build.properties.  Here&#8217;s an example:<br />
<script src="http://gist.github.com/234318.js"></script></p>
<h4>build.properties and version control</h4>
<p>If you&#8217;re working with multiple people, you are probably using a version control system like svn. If you are and you want to avoid people accidentally checking in a build.properties file there are a couple of simple tricks. First, create a copy of build.properties and call it <em>built.properties.template</em> and check that into the repository. Then each user can make a local copy called build.properties. You can also add build.properties to the ignore list for your folder using SVN so that noone will accidentally check it in. Run <code>svn pe svn:ignore</code> and add build.properties to the list. Finally, if you need to make sure that your users have a local copy of  build.properties, <em>there&#8217;s a task for that!â„¢</em> <script src="http://gist.github.com/234320.js"></script></p>
<h3>Adding SVN tasks</h3>
<p>As I work with SVN quite a lot, I found that including SVN in my builds can be quite useful. For example you could:</p>
<ul>
<li>Update your working copy when doing a clean build.</li>
<li>Check in a release build automatically.</li>
<li>Export your source code without those pesky .svn files to be included in a zip file.</li>
<li>Include the revision number of the working copy as a constant definition in the code using <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_21.html#246171">conditional compiliation</a>.</li>
</ul>
<p>To do this, you&#8217;ll need to first download the SVN tasks for ant. They can be found on the <a href="http://subclipse.tigris.org/svnant.html">Tigris.org</a> website. Please note, that these tasks are a part of <a href="http://subclipse.tigris.org/">SubClipse</a>, which is a free interface for working with Subversion from within Eclipse. I don&#8217;t know if the tasks will work without subclispe, but if you haven&#8217;t used it, I&#8217;d definitely recommend trying it out anyway.  By the way, if you use CVS, there are already tasks included in ant.  Once they&#8217;re downloaded, add the task .jars to the libs/ant folder in your project. You&#8217;ll need to use another &lt;typedef&gt; tag in your build script to get these to work. Here&#8217;s an example snippet that simply runs an update on the working copy. You can see all the available commands in the <a href="http://subclipse.tigris.org/svnant/svn.html">svnant documentation</a>.  <script src="http://gist.github.com/234312.js"></script></p>
<p>That&#8217;s it for part 3. In <a href="http://dispatchevent.org/mims/ant-for-flex-part-4/">Part 4</a>, I&#8217;ll talk about setting up a builder for your ant file in FlashBuilder.</p>
]]></content:encoded>
			<wfw:commentRss>http://dispatchevent.org/mims/ant-for-flex-part-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using ant for Flex &#8211; a no B.S. guide &#8211; Part 2 of 4</title>
		<link>http://dispatchevent.org/mims/ant-for-flex-part-2/</link>
		<comments>http://dispatchevent.org/mims/ant-for-flex-part-2/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 01:20:37 +0000</pubDate>
		<dc:creator>Mims H Wright</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tips, Tricks, and Hacks]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[flexbuilder]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tasks]]></category>

		<guid isPermaLink="false">http://dispatchevent.org/?p=760</guid>
		<description><![CDATA[Part 1 Part 2 Part 3 Part 4 In this part, I get more nitty-gritty about working with flex&#8217;s ant tasks. Using the flex ant tasks I spent quite a lot of time making tweaks to get my scripts to use the Flex tasks and hopefully, now you won&#8217;t have to. In the end, there&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://dispatchevent.org/mims/ant-for-flex-part-1/">Part 1</a></li>
<li>Part 2</li>
<li><a href="http://dispatchevent.org/mims/ant-for-flex-part-3/">Part 3</a></li>
<li><a href="http://dispatchevent.org/mims/ant-for-flex-part-4/">Part 4</a></li>
</ul>
<p>In this part, I get more nitty-gritty about working with flex&#8217;s ant tasks.<br />
<span id="more-760"></span></p>
<h3>Using the flex ant tasks</h3>
<p>I spent quite a lot of time making tweaks to get my scripts to use the Flex tasks and hopefully, now you won&#8217;t have to. In the end, <strong>there&#8217;s very little benefit to using the official Flex ant tasks over using a generic &lt;exec&gt; task</strong> (a type of ant task that simply runs an executable file with nested &lt;arg&gt; tags for command line arguments) <strong>and if you&#8217;re having trouble with them, I&#8217;d recommend abandoning the flex tasks and using $lt;exec&gt;</strong>. The main thing I had trouble with was getting the &lt;taskdef&gt; tag to work correctly.</p>
<p>For those new to ant, a &lt;taskdef&gt; tag is a required tag that defines a third-party ant task within the build.xml file. It associates a task name with a .jar file (compiled from the java code for the task). In the case of flex tasks, the java file is typically located within your flexbuilder sdk directory. On my mac, that&#8217;s here:</p>
<p>/Applications/Adobe\ Flash\ Builder\ Plug-in\ Beta\ 2/sdks/${SDK_VERSION}/ant/lib</p>
<p>Where ${SDK_VERSION} is your target sdk version (e.g. 4.0.0). There are a few ways to load additional tasks into your build.xml file. All of them require you to reference the .jar&#8217;s location somehow and then define a new task using &lt;taskdef&gt;.</p>
<ol>
<li><strong>Copy the .jar file for the task into ant&#8217;s lib directory.</strong> I don&#8217;t personally like this option because it makes it very difficult to switch between different versions of the sdk. Also, it requires all users of the script to copy the files on their local machines. (You can also add it to ~/<code>.ant/lib </code>to control the libraries on a user level)</li>
<li><strong>Reference the .jar file&#8217;s location using a command line argument -lib</strong>. Even worse than the first option since it requires each user to add the library manually every time the build script is run.</li>
<li><strong>Include the .jar&#8217;s location inside the build script.</strong> It took me a long time to figure this one out since I didn&#8217;t see it in the manual for ant, but it&#8217;s certainly my preferred method for adding tasks. It allows you to keep everything self contained within the build.xml so changing the location of the .jar is as simple as setting a property in the build script.</li>
</ol>
<p>When using the 3rd option, you then have the question of where is the best place to put the .jar files you want to link to. There are two options that make sense to me.</p>
<ol>
<li>The best place to put non-core tasks required by your build (for a Flex project) is in ${project_home}/libs/ant. This allows you to check your tasks into a repository along with your other referenced files (like .swc files).</li>
<li>Optionally, for the flex tasks you could reference the .jar file directly in the sdk folder. Use this option if the version number of the SDK doesn&#8217;t matter. If it does matter, use the first option. I use this option in my snippet below.</li>
</ol>
<h4>Linking to the official Flex ant tasks</h4>
<p>Here&#8217;s a sample of my flex task definition along with some path definitions that point to various parts of Flex. I said this was a no B.S. guide so if you paste this snippet into your build script, you should be able to use the Flex tasks.<br />
<script src="http://gist.github.com/233455.js?file=FlexAntTaskDefs.xml"></script></p>
<h4>Using the tasks</h4>
<p>Now we have the &lt;typedef&gt; in place and we can actually create a task to compile something. Again, I&#8217;m not going to go into all the details of what <a href="http://ant.apache.org/manual/using.html#targets">targets</a> are all about or go into all the details about the <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_22.html">flex compilers</a>. There are plenty of other tutorials about that. Instead, I&#8217;ll show you a basic target to build an mxml file that is adequate for 95% of projects. Note: you may need to edit the properties defined in these scripts so that they point to the right paths for your project.</p>
<p><script src="http://gist.github.com/234291.js"></script> The toughest part about using these tasks is the seemingly arbitrary words that they expect for the attribute names of some tags (like using <em>path-element</em> in the &lt;source-path&gt; tag but <em>dir</em> in the &lt;library-path&gt; tag). Now the same but this time building a library SWC.  <script src="http://gist.github.com/234288.js"></script></p>
<h4>Making an incremental build</h4>
<p>By default, FlexBuilder uses incremental builds when compiling your source code (except for clean builds). This is a very useful feature of the compiler because it saves time by only compiling the parts of your code that have changed since the last build. You can create an incremental build simply using ant by defining a second task that adds a flag  for incremental building like so. Note that  allows you to run other targets from within a target.</p>
<p><script src="http://gist.github.com/234287.js"></script></p>
<h4>What about ASDocs?</h4>
<p>Even though there are tasks for asc, compc, mxmlc, and generating HTML wrappers, they didn&#8217;t bother to include an asdoc task (actually, they did in Flex SDK 4.0.0). But that&#8217;s okay! As I hinted at earlier, you can still use the  task to run this (as you can for all the other commands) and not only that, it&#8217;s way easier to set up than the official flex tasks! In fact, the only reason that I can think of to use the flex tasks is that they would automatically  use the windows or mac version of the executable depending on your platform. Here&#8217;s an example for asdoc.  <script src="http://gist.github.com/234294.js"></script></p>
<p>That concludes part 2. In <a href="http://dispatchevent.org/mims/ant-for-flex-part-3/">Part 3</a>, I&#8217;ll talk about working with version control systems in ant.</p>
]]></content:encoded>
			<wfw:commentRss>http://dispatchevent.org/mims/ant-for-flex-part-2/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using ant for Flex &#8211; a no B.S. guide &#8211; Part 1 of 4</title>
		<link>http://dispatchevent.org/mims/ant-for-flex-part-1/</link>
		<comments>http://dispatchevent.org/mims/ant-for-flex-part-1/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 01:15:52 +0000</pubDate>
		<dc:creator>Mims H Wright</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Greatest Hits]]></category>
		<category><![CDATA[Tips, Tricks, and Hacks]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[flashbuilder]]></category>
		<category><![CDATA[flexbuilder]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[tasks]]></category>

		<guid isPermaLink="false">http://dispatchevent.org/?p=746</guid>
		<description><![CDATA[After spending hours wrangling with my ant build script and finally making everything work correctly, I am convinced of two things: ant is a very powerful tool for compiling code but it can also do so much more. The support for ant for flex online is abysmally frustrating. So, I&#8217;d love to share with you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://dispatchevent.org/wp-content/uploads/2009/11/QueenAnt.jpg"><img class="alignnone size-full wp-image-784" title="ant" src="http://dispatchevent.org/wp-content/uploads/2009/11/QueenAnt.jpg" alt="About to burst with build targets" width="159" height="159" /></a></p>
<p>After spending hours wrangling with my ant build script and finally making everything work correctly, I am convinced of two things:</p>
<ol>
<li><a href="http://ant.apache.org/manual/index.html">ant</a> is a very powerful tool for compiling code but it can also do so much more.</li>
<li>The support for ant for flex online is abysmally frustrating.</li>
</ol>
<p>So, I&#8217;d love to share with you some of the tips I&#8217;ve picked up after tweaking my script to the point where it finally worked!</p>
<h3>Introducing ant</h3>
<p>First of all, let me introduce the basics of what ant is. I couldn&#8217;t really say it better than the thousands of nameless editors of <a href="http://en.wikipedia.org/wiki/Apache_Ant">WikiPedia</a>.</p>
<blockquote><p><strong>Apache Ant</strong> is a software tool for <a title="Build automation" href="http://en.wikipedia.org/wiki/Build_automation">automating software build</a> processes. It is similar to <a title="Make (software)" href="http://en.wikipedia.org/wiki/Make_%28software%29">Make</a> but is implemented using the <a title="Java (programming language)" href="http://en.wikipedia.org/wiki/Java_%28programming_language%29">Java</a> language, requires the Java platform, and is best suited to building Java projects.</p>
<p>The most immediately noticeable difference between Ant and Make is that Ant uses <a title="XML" href="http://en.wikipedia.org/wiki/XML">XML</a> to describe the build process and its dependencies, whereas Make has its Makefile format. By default the XML file is named <code>build.xml</code>.</p>
<p>Ant is an <a title="Apache Software Foundation" href="http://en.wikipedia.org/wiki/Apache_Software_Foundation">Apache</a> project. It is <a title="Open source software" href="http://en.wikipedia.org/wiki/Open_source_software">open source software</a>, and is released under the <a title="Apache Software License" href="http://en.wikipedia.org/wiki/Apache_Software_License">Apache Software License</a>.</p></blockquote>
<p>So in short, ant lets you use an XML based script to run a series of commands typically used to build software projects. It was originally designed to be &#8220;for Java, in Java&#8221; but it&#8217;s popularity and ease of use has created interest beyond the Java community. For flex, ant can be used for compiling ActionScript and Flex projects into SWFs, creating SWC files, generating documentation with ASDocs, and other actions associated with compiling.</p>
<p>There are a lot of great tutorials online that can cover the basics of how ant works so I&#8217;m not going to go into a general overview in this article. Instead, I&#8217;m going to try to focus on some of the practical aspects of getting a build set up when working with Flex. However, here are some links to the <a href="http://ant.apache.org/manual/">official ant documentation</a> some helpful tutorials for the basics:</p>
<p><a href="http://www.allapplabs.com/ant/ant_basics.htm">Ant Basics tutorial</a></p>
<p><a href="http://flexblog.faratasystems.com/2006/12/05/intro-to-building-and-deploying-flex-applications-with-ant">Another basics tutorial (this time for Flex)</a></p>
<p><a href="http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html">Official Flex documentations</a></p>
<p><a href="http://wiki.apache.org/ant/AntTasks">Ant Folklore</a></p>
<p>After the jump, I&#8217;ll get into some of the ways that ant can be useful for Flash and Flex projects.<br />
<span id="more-746"></span> </p>
<h4>Applications for Flex users</h4>
<p>Is ant right for you? It depends. For most cases, using the standard Run and Debug functions in FlashBuilder or Flash will be completely sufficient. However, if you work on a large development team or on a project with a complicated build process, it might save the group a lot of headache. Here&#8217;s a list of situations where I think Flex ant tasks can be helpful.</p>
<ul>
<li>Whenever your project requires you to make adjustments to the standard build process. For example, when you need to add additional flags to your compiler string.</li>
<li>For Flex projects that are distributed widely, e.g. open source projects, where the configuration of the users&#8217; dev environment is unknown. Build scripts allow users of various versions of FlexBuilder, FDT, or Flex SDK users on different operating systems to all be able to compile a project with more or less the same settings.</li>
<li>If running or building your project requires you to configure options in the command line or to run a local server.</li>
<li>For building release versions of an app and for deploying your app. For example, compiling, zipping and copying an app to a server using FTP.</li>
<li>When you&#8217;re a total nerd and you want to use ant just so you can say you did it.</li>
</ul>
<h3>Beyond Compiling</h3>
<p>One of the main benefits of using ant is that I think many people are unaware of is that it can be  used for many things beyond running compilers. For example, in <a href="http://code.google.com/p/kitchensynclib/">KitchenSync</a>, I use a <a href="http://code.google.com/p/kitchensynclib/source/browse/trunk/build.xml">build script</a> to create a temp folder, compile a SWC file into the temp folder, create an SVN export of the source folder into the temp folder, zip the source and SWC and name it with the current version number, then delete the temp folder.</p>
<p>There are loads of <a href="http://ant.apache.org/manual/coretasklist.html">core tasks</a> that are already defined within the ant library. They handle all types of common actions in the command line. There are even additional <a href="http://ant.apache.org/manual/optionaltasklist.html">optional tasks</a> that add higher-level functionality like copying files to a server using SSH or validating an XML file. Finally, additional tasks can be added simply by creating a new Java class that is a subclass of <code>org.apache.tools.ant.Task</code>. You probably won&#8217;t do this yourself, but there are a number of third-party programs that have created &#8216;plug-in&#8217; tasks for ant such as SVN.</p>
<p>Once Flex projects became larger and more complex, many users began to look for more customizable options and began using ant. A couple of years back, Adobe released some official ant tasks which can now be found bundled in every version of the Flex SDK. However, as I said before the documentation of exactly how to get these tasks running is vague at best.</p>
<p>In <a href="http://dispatchevent.org/mims/ant-for-flex-part-2/">part 2</a>, I&#8217;ll talk about the details of getting flex ant tasks running.</p>
<ul>
<li>Part 1</li>
<li><a href="http://dispatchevent.org/mims/ant-for-flex-part-2/">Part 2</a></li>
<li><a href="http://dispatchevent.org/mims/ant-for-flex-part-3/">Part 3</a></li>
<li><a href="http://dispatchevent.org/mims/ant-for-flex-part-4/">Part 4</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dispatchevent.org/mims/ant-for-flex-part-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>FlexBuilder / Eclipse keyboard shortcuts that will change your life</title>
		<link>http://dispatchevent.org/mims/flexbuilder-keyboard-shortcuts/</link>
		<comments>http://dispatchevent.org/mims/flexbuilder-keyboard-shortcuts/#comments</comments>
		<pubDate>Fri, 01 May 2009 21:09:15 +0000</pubDate>
		<dc:creator>Mims H Wright</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tips, Tricks, and Hacks]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[clip-n-save]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[flexbuilder]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[shortcut]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://dispatchevent.org/?p=707</guid>
		<description><![CDATA[Control + O = Open an outline of functions within the current class to jump to. Command + Shift + T = Jump to a type (class or interface). Only works when an .as or .mxml file is open. Command + Shift + R = Jump to a resource. Includes classes and any other files [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><strong>Control + O</strong> = Open an outline of functions within the current class to jump to.</li>
<li><strong>Command + Shift + T </strong>= Jump to a type (class or interface). Only works when an .as or .mxml file is open.</li>
<li><strong>Command + Shift + R</strong> = Jump to a resource. Includes classes and any other files (such as XML files)</li>
<li><strong>Command + L</strong> = Jump to a line number</li>
<li><strong>Command + Shift + C</strong> = Wrap / Unwrap selected text in a block comment (/* */)</li>
<li><strong>Command + Shift + /</strong> = Comment / uncomment the selected line usingÂ  an inline comment (//)</li>
<li><strong>Command + Shift + D</strong> = Add ASDoc style comment</li>
<li><strong>Command + D</strong> = Delete the selected text</li>
<li><strong>Command + UP</strong> = Move the selected up</li>
<li><strong>Command + DOWN</strong> = Move the selected text down</li>
<li><strong>Command + Option + UP</strong> or <strong>DOWN</strong> = Duplicate the selected text above or below the selected line</li>
<li><strong>Command + X</strong> = Make selected text ALL CAPS</li>
<li><strong>Command + Y</strong> = Make selected text all lowercase</li>
<li><strong>Command + Shift + R</strong> = Rename selected element (using refactor)</li>
<li><strong>Command + M</strong> = Maximize / Minimize current view</li>
<li><strong>Control + Tab</strong> = Jump to an open file editor</li>
<li><strong>Command + Shift + L</strong> = Keyboard command list. Press it again to edit commands.</li>
<li><strong>Command + F</strong> = Find / Replace dialog.</li>
<li><strong>Command + Shift + G</strong> = Find any references to the selected element within your project</li>
<li><strong>Command + Click</strong> or<strong> F3</strong> = Jump to the definition of the selected element</li>
<li><strong>Command + J</strong> = Find within document. Type the word you want to find then use up and down to skip between instances. Press ESC to cancel.</li>
<li><strong>Command + Shift + P</strong> = Jump to matching bracket. e.g. jump from } to {</li>
<li><strong>Control + H</strong> = Search (rather than find) allows you to search within the entire workspace.</li>
<li><strong>Tab / Shift + Tab </strong>= Indent / Un-indent selected text.</li>
<li><strong>Command + Option + Left / Right</strong> = Jumps to the location of the previous / next edit without undoing your change.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dispatchevent.org/mims/flexbuilder-keyboard-shortcuts/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Using XML Schemas in Eclipse / FlexBuilder</title>
		<link>http://dispatchevent.org/mims/using-xml-schemas-in-eclipse-flexbuilder/</link>
		<comments>http://dispatchevent.org/mims/using-xml-schemas-in-eclipse-flexbuilder/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 05:00:16 +0000</pubDate>
		<dc:creator>Mims H Wright</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips, Tricks, and Hacks]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[flexbuilder]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xml-schema]]></category>
		<category><![CDATA[xsd]]></category>

		<guid isPermaLink="false">http://dispatchevent.org/?p=626</guid>
		<description><![CDATA[UPDATE: After reading the entry by Misprintt on the SchemaManager and XMLDecoder more thoroughly, I felt the need to tell you all to go check it out! This is a very powerful undocumented feature of Flex (why undocumented?) that could potentially save loads of time on a larger project. Along with the rest of this [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE:</strong> After reading the <a href="http://blog.misprintt.net/?p=192">entry by Misprintt on the SchemaManager and XMLDecoder</a> more thoroughly, I felt the need to tell you all to go check it out! This is a very powerful undocumented feature of Flex (why undocumented?) that could potentially save loads of time on a larger project. Along with the rest of this article, you could automate the parsing of your XML files into bindable model classes with ease.</p>
<p><a href="http://www.w3schools.com/Schema/default.asp">XML-Schema</a> (.XSD extension) are documents used to describe the format of XML files. They are similar to DTD (Document type declaration) files but much more powerful.</p>
<p><a href="http://dispatchevent.org/wp-content/uploads/2009/02/picture-1.png"><img class="alignnone size-full wp-image-633" title="xsd editor" src="http://dispatchevent.org/wp-content/uploads/2009/02/picture-1.png" alt="xsd editor" width="435" height="355" /></a></p>
<p>While working on some XML documents for a Flash site, I stumbled across the XML-Schema editor for Eclipse. The editor shows the XSD as a graphical representation of the model that you&#8217;re editing that looks similar to a UML class diagram.</p>
<p><a href="http://wiki.eclipse.org/index.php/Introduction_to_the_XSD_Editor">Here&#8217;s a great article on how it works.</a></p>
<h3><span id="more-626"></span>Benefits of using XSD</h3>
<p>As I said, XSD allows you to define the format of your XML document but with much more detail that DTD.</p>
<ul>
<li>XSD allows you to type your data (integers, strings, booleans) so that you can better predict what format the xml will be</li>
<li>It allows the creation of custom types which gives it an object oriented aspect</li>
<li>You can use all kinds of restrictions for what kind of content can appear within a tag including the number of elements, whether values are required or not, you can even use regular expressions to limit the acceptable values. This is very nice when you&#8217;re working with a 3rd party who is generating the XML data.</li>
<li>Using an XSD file can allow you to automate the validation of an XML file&#8217;s format</li>
</ul>
<p>Once you&#8217;ve created your XSD file, you can use the new XML document wizard to create an XML file that links to your schema file. The wizard will automatically populate the XML document with valid data! Furthermore, as you edit the XML file you will get warnings and errors if you go outside the formatting requirements defined in the XSD. For example, if you define a tag &lt;description&gt; as having a maximum length of 128, you will see a visual error if your tag contains more than 128 characters. It&#8217;s a great way to forsee problems as you write them.</p>
<p><span style="text-decoration: line-through;">I hope in the future to write some kind of tool to parse XML based on an XSD file in flash.</span> Apparently, Adobe had created an undocumented Flex feature to validate XML against XSD. <a href="http://blog.misprintt.net/?p=181">Via Misprintt</a></p>
<h3>Installing the XML extensions</h3>
<p>Unfortunately, the editor is not installed by default and nstalling software in Eclipse is not very intuitive. I&#8217;ve done my best to describe the process here but if you need further help, <a href="http://dispatchevent.org/mims/pimp-my-clipse-a-list-of-must-have-eclipse-plug-ins-for-flexflash-development/">check this entry</a>.</p>
<ol>
<li>Open Eclipse or FlexBuilder</li>
<li>Go to Help&gt;Software Updates&#8230; ( &gt; Find and Install for Eclipse 3.3)<br />
<a href="http://dispatchevent.org/wp-content/uploads/2009/02/softwareupdate.png"><img class="alignnone size-full wp-image-630" title="softwareupdate" src="http://dispatchevent.org/wp-content/uploads/2009/02/softwareupdate.png" alt="softwareupdate" /></a></li>
<li>Make sure you have the <a href="http://www.eclipse.org/europa/">Europa</a> or <a href="http://www.eclipse.org/ganymede/">Ganymede</a> update sites in the list of update sites:
<pre style="margin: 0em;">Eclipse 3.4 users:
<a class="external free" title="http://download.eclipse.org/releases/ganymede/" rel="nofollow" href="http://download.eclipse.org/releases/ganymede/">http://download.eclipse.org/releases/ganymede/</a>

<a href="http://download.eclipse.org/releases/europa/site.xml">http://download.eclipse.org/releases/europa/site.xml</a></pre>
</li>
<li>Select the XML and XSD extensions in this screenshot. In Eclipse 3.4 you can search for them, in 3.3 you will have to look through the packages for them manually.<a href="http://dispatchevent.org/wp-content/uploads/2009/02/xmlextensions.png"><img class="alignnone size-full wp-image-629" title="xmlextensions" src="http://dispatchevent.org/wp-content/uploads/2009/02/xmlextensions.png" alt="xmlextensions" width="400" /></a></li>
<li>Restart Eclipse after the install is complete</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://dispatchevent.org/mims/using-xml-schemas-in-eclipse-flexbuilder/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Iron Flash Competition LA 2009</title>
		<link>http://dispatchevent.org/mims/iron-flash-09/</link>
		<comments>http://dispatchevent.org/mims/iron-flash-09/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 18:41:51 +0000</pubDate>
		<dc:creator>Mims H Wright</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[IRL]]></category>
		<category><![CDATA[Videogames]]></category>
		<category><![CDATA[competition]]></category>
		<category><![CDATA[ironflash]]></category>
		<category><![CDATA[LA]]></category>
		<category><![CDATA[lafug]]></category>

		<guid isPermaLink="false">http://dispatchevent.org/?p=679</guid>
		<description><![CDATA[Last night, I participated in the Iron Flash competition at the LA Flash Users Group in Venice Beach. As in Iron Chef (my favourite television show), the participants are all skilled Flash users pitted against one another with the goal of creating something interesting within a strict time limit and featuring a common &#8220;ingredient&#8221;. In [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-680" title="ironchef" src="http://dispatchevent.org/wp-content/uploads/2009/04/ironchef.jpg" alt="ironchef" width="186" height="195" /></p>
<p>Last night, I participated in the Iron Flash competition at the <a href="http://groups.adobe.com/groups/c27a8adb00/summary">LA Flash Users Group</a> in Venice Beach. As in <a href="http://www.youtube.com/watch?v=u2e9nTeIwFk">Iron Chef</a> (my favourite television show), the participants are all skilled Flash users pitted against one another with the goal of creating something interesting within a strict time limit and featuring a common &#8220;ingredient&#8221;. In this case, the ingredient was a set of pictures of &#8216;pucks&#8217;, specifically, R. Blank&#8217;s dog Puck, Puck the faun, Puck from the Real World, and a hockey Puck. We had 3 hours to make something out of any or all of the pictures. My fellow competitors were Jon Ruppel of <a href="http://hookyinteractive.com">Hooky Interactive</a> and <a href="http://www.benmcmaster.com">Ben McMaster</a> (also at Hooky) who both made some awesome stuff in such a short time. UPDATE: All of the entries have been posted on <a href="http://richmediainstitute.com/ironflasher3">the LAFlash site</a>.</p>
<p>It was a great experience, and not just because OMG I WON!!!</p>
<p>My entry was a video game featuring Puck the dog. I was considering other physics based games involving the hockey puck and the dog somehow. Then I thought of using the dog instead of the hockey puck and somehow that reminded me of the sport beloved in Canada, Curling! The scoring system is a little wonky but if I may say so, it&#8217;s not bad for 3 hours work. Here are screenshots (click to link to the game) along with the source code:</p>
<p><a href="http://dispatchevent.org/wp-content/uploads/2009/04/puckcurling.zip">Download the source code</a></p>
<p><a href="http://mimswright.com/work/puckcurling/"><img class="alignnone size-full wp-image-685" title="puckcurling-title" src="http://dispatchevent.org/wp-content/uploads/2009/04/puckcurling-title.jpg" alt="puckcurling-title" width="487" height="189" /></a></p>
<p><a href="http://mimswright.com/work/puckcurling/"><img class="alignnone size-full wp-image-684" title="puckcurling-gameplay" src="http://dispatchevent.org/wp-content/uploads/2009/04/puckcurling-gameplay.jpg" alt="puckcurling-gameplay" width="491" height="191" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://dispatchevent.org/mims/iron-flash-09/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Fast Intro to Flash</title>
		<link>http://dispatchevent.org/calebjohnston/fast-intro-to-flash/</link>
		<comments>http://dispatchevent.org/calebjohnston/fast-intro-to-flash/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 04:07:42 +0000</pubDate>
		<dc:creator>Caleb Johnston</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Meta]]></category>

		<guid isPermaLink="false">http://dispatchevent.org/?p=620</guid>
		<description><![CDATA[There is plenty of documentation, tutorials and explanation of Flash on the internet, blogs and books. However, it&#8217;s hard for me to find a good, concise article that covers Flash well. I&#8217;ve been exposing Flash 9 to a friend of mine recently and I&#8217;ve decided that a concise explanation is something I should write. This [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: Arial;">There is plenty of documentation, tutorials and explanation of Flash on the internet, blogs and books. However, it&#8217;s hard for me to find a good, concise article that covers Flash well. I&#8217;ve been exposing Flash 9 to a friend of mine recently and I&#8217;ve decided that a concise explanation is something I should write. This post will be brief, high level and will cover Flash as a platform and not the Flash IDE. This article is also intended for those with previous exposure to technical concepts such as virtual machines and compilers.<br style="font-family: Arial;" /> </span><span id="more-620"></span><br style="font-family: Arial;" /><strong><span style="font-family: Arial;">Overview</span></strong><br />
<span style="font-family: Arial;">Flash is a platform for building and deploying interactive multimedia on the internet. The term Flash is ambiguous because it can be used to describe the runtime environment (Flash Player) or one of two IDEs targeting the player (Adobe Flash and Adobe Flex Builder). Flash currently uses an ECMA-based scripting language known as Actionscript for authoring. This same language is used across all of Adobe&#8217;s platform -which includes Adobe AIR, Adobe Flex, and Adobe Flash. Actionscript uses a <em>strong, static, safe</em> type system which makes it&#8217;s syntax more similar to Java than Javascript.</span></p>
<p><strong><span style="font-family: Arial;">Runtime Environment</span></strong></p>
<p><span style="font-family: Arial;"><strong>SWF Files</strong></span><br style="font-family: Arial;" /><span style="font-family: Arial;">Swf files are compressed, multipurpose </span><span style="font-family: Arial;">packages designed to contain the following data: raster and vector graphics, video, audio, text, fonts, animation, and actionscript code. Swfs can be loaded at runtime whenever necessary and can use both static and dynamic linking based upon the compiler settings. The runtime environment uses security sandboxes for loaded swf files. The security settings primarily limit the extent of filesystem access and cross-domain access that swf files can use. Adobe has <a id="jj8r" title="provided the swf file format spec" href="http://www.adobe.com/devnet/swf/">provided the swf file format spec</a> and has recently provided the <a id="k0w6" title="FLV video format spec" href="http://www.adobe.com/devnet/flv/">FLV video format spec</a> and <a id="drt9" title="has declared that they will provide the RTMP specs" href="http://www.adobe.com/aboutadobe/pressroom/pressreleases/200901/012009RTMP.html">has declared that they will provide the RTMP spec</a> as well.</span><br />
<span style="font-family: Arial;"><strong><br />
Flash Player &amp; AVM2</strong><br />
The Flash Player runtime is a very light-weight, virtual machine and handles system calls. The Flash Player includes both AVM1 (AS1, AS2, for Flash versions 1-8) and AVM2  (AS3 for Flash 9,10+) which processes compiled <a id="obh5" title="Adobe Byte Code" href="http://www.anotherbigidea.com/javaswf/avm2/AVM2Instructions.html">Adobe Bytecode</a> (ABC). The term AVM stands for &#8220;ActionScript Virtual Machine&#8221;<strong>*</strong>. </span><span style="font-family: Arial;">The Flash Player uses a Deferred Reference Counting (DRC) mechanism combined with a conservative mark/sweep garbage collector.</span><span style="font-family: Arial;"> The Adobe VM uses both JIT compiling and code interpretation and may benefit from compile-time bytecode optimizations based upon compiler input parameters. AS3 computational performance is generally closer to Java than Javascript [<a id="zbpr" title="AS3 performance vs Java vs Javascript" href="http://www.oddhammer.com/actionscriptperformance/set4/">source</a>]. The player also maintains a variable framerate that reflects the time consumed for each frame update [<a id="w455" title="source" href="http://www.onflex.org/ted/2005/07/flash-player-mental-model-elastic.php">source</a>]. Each frame update consists of multiple stages that include internal player processing, rendering, and author script processing. The program framerate is the principle metric reflecting application performance.<br />
<span style="font-family: Arial;"><br style="font-family: Arial;" /></span><span style="font-size: small;"><strong><span style="font-family: Arial;">Development Environment</span></strong></span></span></p>
<p><strong><span style="font-family: Arial;">Actionscript API</span></strong><br style="font-family: Arial;" /> <span style="font-family: Arial;">The Actionscript API is divided up amongst the Adobe AIR environment, the Flex environment, and the Flash environment and the Flash Player</span><span style="font-family: Arial;">.</span><span style="font-family: Arial;"> The source for all the packages are divided up amongst <a id="lc9l" title="swc files" href="http://livedocs.adobe.com/flex/3/html/building_overview_5.html">swc files</a>. Swc files are pre-compiled catalogs of classes and assets. They are similar to swf files but they are used for compile-time dependency resolution. Furthermore, the native swc&#8217;s predominantly contain code and not visual assets. An overview of the Actionscript packages is kept up to date in the <a id="y1w4" title="Adobe Actionscript 3 package summary" href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/package-summary.html">Adobe Live Docs</a>.</span></p>
<p><span style="font-family: Arial;"><strong>The Flash IDE</strong><br />
The Flash IDE was designed for designers, artists and animators. So, it is equiped with a layer system which reflects the stage display list and a hierarchical timeline which reflects the temporal nature of the runtime. The objects placed on the stage are represented by the timeline and can be &#8220;tweened&#8221; (using runtime interpolated 2D geometric transformations or custom shape morphs). The same timeline is also used for object creation and destruction. All stage instances are confined to a small set of native data types including: MovieClips, Sprites, Shapes, <span style="font-family: Arial;">TextFields, </span><span style="font-family: Arial;">Videos, and Bitmaps. The IDE also has a library that contains source objects for all stage instances and even instances that aren&#8217;t used on the stage. Flash projects often have several build targets (compiled swf files) that use parts of the project codebase. After Macromedia was purchased by Adobe, the Flash authoring environment has been updated to provide much better interoperability with the Adobe Creative Suite.</span></span></p>
<p><span style="font-family: Arial;"><strong>Adobe Flex Builder</strong><br />
Flex Builder is an Eclipse-based Actionscript IDE for writing and compiling swf files. Flex Builder is primarily designed to build &#8220;Flex&#8221; projects which can be written in an interface tagging language known as MXML. MXML is a declarative XML langauge used to define interface elements in a project. MXML files provide the &#8220;view&#8221; in the MVC software design pattern. Flex Builder also provides plenty of useful features like code completion, syntax formatting, active debugging, memory profiling, and project building that expose errors and warnings during development time. Because the Flex framework is not bundled with the Flash Player, Flex projects must statically link to all swc assets specific to Flex which amounts to greater than 500kb. This is very unnatractive for most users, thus Adobe has provided <a id="ilsr" title="means by which the download can be significantly decreased" href="http://onflash.org/ted/2008/01/flex-3-framework-caching.php">means by which the download can be significantly decreased</a>. Flex Builder is also used to deploy applications for the <a id="kwwz" title="Adobe AIR platform" href="http://en.wikipedia.org/wiki/Adobe_Integrated_Runtime">Adobe AIR platform</a>. Adobe AIR is a desktop runtime that combines <a id="ffsj" title="webkit" href="http://webkit.org/">webkit</a> with the AVM2 portion of the Flash Player. AIR can be likened to a closed sourceÂ <a id="k10e" title="Java SE" href="http://en.wikipedia.org/wiki/Java_SE">Java SE</a> runtime but provides a smaller learning curve and greater accessibility than what comes with the Java ecosystem. </span></p>
<p><span style="font-family: Arial;"><strong>Compiler</strong><br />
Since Adobe has launched the Flex platform they have provided free access to their Flex and Actionscript compiler and SDK. They have also provided open source projects under the <a id="mz0t" title="Mozilla public license" href="http://en.wikipedia.org/wiki/Mozilla_Public_License">Mozilla public license</a>. The compiler (<a id="n5hv" title="Adobe Flex 3 Help - Compilers" href="http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_13.html">mxmlc</a>) provides an impressive amount of flexibility and customization for swf compiling. It can be configured with command line options or a <a id="xwm0" title="configuration XML file" href="http://livedocs.adobe.com/flex/3/html/compilers_11.html#134938">configuration XML file</a>.</span></p>
<p><span style="font-family: Arial;"><em><strong>* </strong>correction 09-12-2009, I had previously stated that the term AVM meant &#8220;Adobe Virtual Machine&#8221;, this is a mixup. It actually means &#8220;ActionScript Virtual Machine&#8221;. Thanks dbam.</em></span></p>
]]></content:encoded>
			<wfw:commentRss>http://dispatchevent.org/calebjohnston/fast-intro-to-flash/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Flash Player 10 &#8211; 3D Example</title>
		<link>http://dispatchevent.org/calebjohnston/flash-player-10-3d-example/</link>
		<comments>http://dispatchevent.org/calebjohnston/flash-player-10-3d-example/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 16:06:27 +0000</pubDate>
		<dc:creator>Caleb Johnston</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Lab]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[Flash 10]]></category>

		<guid isPermaLink="false">http://dispatchevent.org/?p=431</guid>
		<description><![CDATA[I&#8217;ve tinkered a bit with Flash Player 10. One thing that seems almost funny about the 3D effects of Flash thus far is that very few examples show off actually 3D objects. Most examples I&#8217;ve examined show 2D planes transformed in 3D space. So, I&#8217;ve created a sample 3D cube primitive in AS3 as a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve tinkered a bit with Flash Player 10. One thing that seems almost funny about the 3D effects of Flash thus far is that very few examples show off actually 3D objects. Most examples I&#8217;ve examined show 2D planes transformed in 3D space. So, I&#8217;ve created a sample 3D cube primitive in AS3 as a convenient example for people who want to get started with their own parsers or drawing tools (etc).</p>
<p><span id="more-431"></span></p>
<p>My current configuration is Mac OS X 5.2 + TextMate 1.5.7 + Flex SDK 4.0.0.3504. I have two shell scripts in place:<a title="txt version of textmate bundle command" href="http://www.calebjohnston.com/storage/scripts/textmate_compile.txt"><br />
</a></p>
<ol>
<li><a title="txt version of mxmlc script" href="http://www.calebjohnston.com/storage/scripts/mxmlc.txt">/usr/bin/mxmlc</a></li>
<li><a title="txt version of textmate bundle command" href="http://www.calebjohnston.com/storage/scripts/textmate_compile.txt">A TextMate run bundle</a> set to a hotkey, &#8220;command + R&#8221;</li>
<li>I&#8217;ve also have my <a title="Flex 4 SDK download" href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4">Flex SDK</a> set to the absolute path of: <em>/Developer/SDKs/Flex/4.0.0.3504</em></li>
</ol>
<p>This configuration requires a flex-config.xml in the same directory as the AS3 class file that you&#8217;re compiling. When you run the TextMate script (or something similar in your Terminal shell) it will compile the filename you pass in and default to using a config.xml which acts as a local flex-config.xml file. All of these can be customized as needed.</p>
<p>Example Flash 10 3D cube rotation:<br />
[kml_flashembed movie="http://www.calebjohnston.com/storage/fl10_examples/01_cube_rotation/CubeRotationExample.swf" height="260" width="410" bgcolor="#FFFFFF" /]</p>
<p>Obviously, the above swf won&#8217;t work without Flash player 10 installed.</p>
<p><a title="Flash 10 3D cube rotation example source" href="http://www.calebjohnston.com/storage/fl10_examples/01_cube_rotation.zip">Download the source here.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dispatchevent.org/calebjohnston/flash-player-10-3d-example/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Double Dissapointment</title>
		<link>http://dispatchevent.org/calebjohnston/double-dissapointment/</link>
		<comments>http://dispatchevent.org/calebjohnston/double-dissapointment/#comments</comments>
		<pubDate>Sat, 23 Aug 2008 00:22:59 +0000</pubDate>
		<dc:creator>Caleb Johnston</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Discussion]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Meta]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Videogames]]></category>
		<category><![CDATA[standards]]></category>

		<guid isPermaLink="false">http://dispatchevent.org/?p=319</guid>
		<description><![CDATA[ECMA script 4 (or 3.1) and OpenGL 3. I may be in the (rare?) position of being highly interested in two disparate technologies. The first being an online scripting language standard governed by ECMA (used in Javascript &#38; Actionscript). The second, an open standard for real-time rendering governed by the Khronos Group (OpenGL). In recent [...]]]></description>
			<content:encoded><![CDATA[<p><a title="ES 3.1 harmony" href="http://ejohn.org/blog/ecmascript-harmony/">ECMA script 4 (or 3.1)</a> and <a title="OpenGL 3 spec" href="http://www.tojiart.com/OpenGL/">OpenGL 3</a>.</p>
<p>I may be in the (rare?) position of being highly interested in two disparate technologies. The first being an online scripting language standard governed by <a title="ECMA international standards organization" href="http://www.ecma-international.org/">ECMA</a> (used in Javascript &amp; Actionscript). The second, an open standard for real-time rendering governed by the <a title="Khronos group" href="http://www.khronos.org/">Khronos Group</a> (<a title="OpenGL" href="http://en.wikipedia.org/wiki/OpenGL">OpenGL</a>). In recent days these two languages have faced most unfortunate developments. First the ECMA script 4&#8230;</p>
<p><span id="more-319"></span></p>
<p>On Nov 7, 2006 Adobe announced the <a title="Emmy Huang on Tamarin" href="http://www.adobe.com/devnet/logged_in/ehuang_tamarin.html">contribution of their ECMA scripting engine to the open source community</a> under the name &#8220;Tamarin&#8221;. <a title="Tamarin project home" href="http://www.mozilla.org/projects/tamarin/">Tamarin</a> is also being used as the JS scripting engine for Mozilla Firefox under the name &#8220;<a title="SpiderMonkey project home" href="http://www.mozilla.org/js/spidermonkey/">SpiderMonkey</a>&#8220;. It seemed like a good idea at the time of release. But now look at the situation: we have AVM2, directly connected to Firefox AND the ECMA committee &#8211;slowing the progress of Actionscript and the Flash Player (and the internet for that matter). Needless to say, this is a disappointment. But it doesn&#8217;t end there&#8230;</p>
<p>Though having plenty of contributors, the realm of real-time rendering is primarily controlled by Microsoft, Nvida, ATI/AMD, Apple, and (more recently) Intel. Microsoft hasn&#8217;t really contributed to the Khronos Group because long ago they decided to pursue their own 3D graphics rendering API known as Direct3D. The evolution of OpenGL has become painfully slow while <a title="DirectX API" href="http://en.wikipedia.org/wiki/DirectX">DirectX</a> and <a title="D3D API" href="http://en.wikipedia.org/wiki/Direct3D">Direct3D</a> are becoming the (de-facto) standard. Finally, the Khronos group promised to improve the long lost API by introducing an object-oriented structure in stark contrast to its current state machine model. That was in October 2007. Last week the specification was finally unveiled and it remains largely the same. Not only is this a big let down, but it will definitely damage all future 3D software and game development releases for non-Windows platforms (including future consoles). Very unfortunate.</p>
<h5>DISCLAIMER: Both of these developments are FAR more complex than what this post outlines -and there&#8217;s justification behind both developments. But on the whole, they both seem bad for everybody (or just me?).</h5>
]]></content:encoded>
			<wfw:commentRss>http://dispatchevent.org/calebjohnston/double-dissapointment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Actionscript 3 performance tuning review</title>
		<link>http://dispatchevent.org/calebjohnston/as3-performance-tuning/</link>
		<comments>http://dispatchevent.org/calebjohnston/as3-performance-tuning/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 16:34:47 +0000</pubDate>
		<dc:creator>Caleb Johnston</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://dispatchevent.org/?p=285</guid>
		<description><![CDATA[After late-night conversations amongst coworkers and friends over beers, I&#8217;ve discovered that many flash developers remain unfamiliar with AVM2&#8242;s inter workings. A while ago, I found a couple documents which have benefited me greatly in understanding AVM2 and AS3: Actionscript 3.0 and Performance Tuning AVM2 Overview There are definitely some big take-aways in these two [...]]]></description>
			<content:encoded><![CDATA[<p>After late-night conversations amongst coworkers and friends over beers, I&#8217;ve discovered that many flash developers remain unfamiliar with AVM2&#8242;s inter workings. A while ago, I found a couple documents which have benefited me greatly in understanding AVM2 and AS3:</p>
<p><a href="http://www.onflex.org/ACDS/AS3TuningInsideAVM2JIT.pdf">Actionscript 3.0 and Performance Tuning</a></p>
<p><a href="http://www.adobe.com/devnet/actionscript/articles/avm2overview.pdf">AVM2 Overview</a></p>
<p>There are definitely some big take-aways in these two documents. I would list them here, but then you might not read them for yourself! ;)</p>
<p>The first document is 74 powerpoint slides (prepared by Gary Grossman of Adobe) which is very useful for getting a quick understanding of AVM2 topics such as garbage collection, the benefits of strong typing, the Actionscript byte code (abc) format, the code interpreter and JIT compilation. For an AS3 developer this is a must-read.</p>
<p>The second document is a bit more dense. It contains 108 pages of more formally described underpinnings of the virtual machine. It focuses a lot on how your AS3 code will ultimately be run as processor instructions. Its a great follow-up to the first document. If you&#8217;re a geek, I would highly recommend reading this overview.</p>
]]></content:encoded>
			<wfw:commentRss>http://dispatchevent.org/calebjohnston/as3-performance-tuning/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Tweening timeline animations with KitchenSync</title>
		<link>http://dispatchevent.org/mims/tweening-timeline-animations-with-kitchensync/</link>
		<comments>http://dispatchevent.org/mims/tweening-timeline-animations-with-kitchensync/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 23:31:33 +0000</pubDate>
		<dc:creator>Mims H Wright</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Lab]]></category>
		<category><![CDATA[physics & motion]]></category>
		<category><![CDATA[Site-seeing]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Videogames]]></category>
		<category><![CDATA[KitchenSync]]></category>

		<guid isPermaLink="false">http://dispatchevent.org/?p=284</guid>
		<description><![CDATA[One of the new features in KitchenSync 1.5 is the ability to tween animations on a MovieClip&#8217;s timeline&#8230; and I&#8217;m not just talking about gotoAndPlay(), I&#8217;m talking about controlling the starting and stopping points, speed, and easing functions of an animation on the timeline with code. It does this by incrementally controlling the current frame [...]]]></description>
			<content:encoded><![CDATA[<p>One of the new features in <a href="http://dispatchevent.org/mims/kitchensync-v1-5/">KitchenSync 1.5</a> is the ability to tween animations on a MovieClip&#8217;s timeline&#8230; and I&#8217;m not just talking about gotoAndPlay(), I&#8217;m talking about controlling the starting and stopping points, speed, and easing functions of an animation on the timeline with code. It does this by incrementally controlling the current frame number of the MovieClip using a <a href="http://as3lib.org/kitchensync/docs/api/org/as3lib/kitchensync/action/KSTween.html">KSTween</a> and a special <a href="http://as3lib.org/kitchensync/docs/api/org/as3lib/kitchensync/action/tweentarget/ITweenTarget.html">ITweenTarget</a> (a class used to control the values of an object) called <a href="http://as3lib.org/kitchensync/docs/api/org/as3lib/kitchensync/action/tweentarget/TimelineController.html"><strong>TimelineController</strong></a>.</p>
<p>Take this FLA animation.</p>
<p><a href="http://dispatchevent.org/wp-content/uploads/2008/07/timelineAnimationStill.png"><img src="http://dispatchevent.org/wp-content/uploads/2008/07/timelineAnimationStill.png" alt="MovieClip animation" /></a></p>
<p>As you can see, there is a simple animation using a guide layer and labels on the key frames.</p>
<p><span id="more-284"></span></p>
<p>The following SWF uses KitchenSync to control the same ball animation. As you can see, the duration and easing functions of the animation can be controlled. You can even animate backwards!</p>
<p><a href="/wp-content/uploads/2008/07/FlashIntegrationTest.swf">See it in action.</a></p>
<p>The source that controls this is here.</p>
<pre lang="actionscript3">package {
	import flash.display.MovieClip;

	import org.as3lib.kitchensync.KitchenSync;
	import org.as3lib.kitchensync.action.*;
	import org.as3lib.kitchensync.action.tweentarget.*;
	import org.as3lib.kitchensync.easing.Bounce;
	import org.as3lib.kitchensync.easing.Cubic;
	import org.as3lib.kitchensync.easing.Linear;
	import org.as3lib.kitchensync.easing.Oscillate;

	/**
	*	Demos the TimelineController which controls the animation of a MovieClip's timeline.
	*/
	public class FlashIntegrationTest extends MovieClip
	{
		protected var test1:MovieClip;

		public function FlashIntegrationTest()
		{
			super();
			// initialize kitchensync.
			KitchenSync.initialize(this, "1.5");

			// add a movieclip from the library
			test1 = MovieClip(new AnimationTest1());
			addChild(test1);

			// define the start and end frame with strings or ints or FrameLabel's
			var startLabel:* = "start";
			var endLabel:* = "end";

			// set up the TimelineController tween target.
			var tweenTarget:TimelineController = new TimelineController(test1, startLabel, endLabel);
			// Animate the ball with a linear ease.
			var tween:KSTween = KSTween.newWithTweenTarget(tweenTarget, "1s", 0, Linear.ease);

			// animate the ball backwards with a bounce tween
			var tween2:KSTween = tween.cloneReversed();
			tween2.duration = "4s";
			tween2.easingFunction = Bounce.easeOut;
			tween2.addTrigger(tween);

			// animate the ball with an oscillator
			var tween3:KSTween = KSTween.newWithTweenTarget(tweenTarget, "10m", "1s", Oscillate.sine);
			tween3.easingMod1 = 0.3;
			tween3.addTrigger(tween2);

			// start the animations
			tween.start();
		}

	}
}</pre>
<p>Pretty cool huh? We&#8217;re creating a new TimelineController and setting the boundaries of the animation then passing it to a new KSTween object. Each of the three tweens use different parameters and are triggered by the end of the one before it.</p>
<p>You can <a href="http://dispatchevent.org/wp-content/uploads/2008/07/timelineControllerDemo.zip">download the entire thing</a> and play around with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://dispatchevent.org/mims/tweening-timeline-animations-with-kitchensync/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Introduction to Flex Resource Bundles</title>
		<link>http://dispatchevent.org/roger/introduction-to-flex-resource-bundles/</link>
		<comments>http://dispatchevent.org/roger/introduction-to-flex-resource-bundles/#comments</comments>
		<pubDate>Fri, 09 May 2008 06:31:08 +0000</pubDate>
		<dc:creator>Roger Braunstein</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Greatest Hits]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/introduction-to-flex-resource-bundles</guid>
		<description><![CDATA[Hark, Flex developers. Lend me your ears! I must take this post to implore you: use Resource Bundles! Trust me, I know, there&#8217;s a lot to keep up with these days, but if you aren&#8217;t already privy to the awesome secrets of the humble bundle, hopefully I can help convince you to use them. I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>Hark, Flex developers. Lend me your ears! I must take this post to implore you: use Resource Bundles! Trust me, I know, there&#8217;s a lot to keep up with these days, but if you aren&#8217;t already privy to the awesome secrets of the humble bundle, hopefully I can help convince you to use them. I&#8217;ll show you how, without breaking one bead of sweat from your brow! First, let me tell you why they&#8217;re cool. Then, I&#8217;ll show you how to get rolling with your first bundle. Then, I&#8217;ll set you loose, and hopefully you can all write in with excellent questions and help me make this a great resource for the next readers! Read on, fair Flexer.<br />
<span id="more-251"></span></p>
<h3>Why Bundles Will Give You a New Brain</h3>
<p><a href="http://www.comedycentral.com/videos/index.jhtml?videoId=60667&#038;title=power-marketing"><img src="http://partlyhuman.com/articles/resource-bundles/new-brain.jpg" style="float: right; margin-left: 1em" alt="This is from Upright Citizens Brigade. I don't advocate getting really high every day or doing your dishes in the bathtub."/></a></p>
<p>Eight years ago, I weighed 500lbs. I was getting really high every day. And I was washing my dishes in the bathtub.  But thanks to resource bundles, I own a mansion, I&#8217;ve got a summer home in Maine, I got an awesome boat, I got a jet pack, and I got a sweet lookin&#8217; wife.</p>
<p>What&#8217;s a resource bundle? It&#8217;s a <em>set of values</em> that you <em>externalize</em> from your source code in a <em>properties file</em>. And it can be swapped out at compile time or, with Flex 3, at runtime. Think of it like a style sheet for values. Most of the time, these values are text. But without too much hassle, you can use resource bundles to parameterize all types of data.</p>
<p>Resource bundles are probably most useful, and most commonly used for, <em>localization</em>. Localization (pardon the didacticism) is the process of making software comprehensible for multiple regions with different languages or ways of writing. Sometimes you&#8217;ll see this term written L10n. For example, in porting your &#8220;Hello, world&#8221; application for a Japanese audience, you&#8217;d probably make it say something like &#8220;ä»Šæ—¥ã¯ã€ä¸–ç•Œ&#8221; instead. Resource bundles are <em>perfect</em> for supporting multiple locales.</p>
<p>This obvious use case, I&#8217;m afraid, might have prevented many of you from looking into resource bundles. If resource bundles are for localization, and you&#8217;re building a site that doesn&#8217;t need to be localized, you might well overlook their benefits, as I did for some time. However, here&#8217;s some of the benefits of using resource bundles &#8212; even if it&#8217;s <em>just one single bundle</em>.</p>
<p>Using resource bundles, you can give every application you write a copy deck. If you&#8217;ve worked with almost any client ever, I&#8217;m sure you&#8217;ve had to make a copy change. Who wants to go digging through source code to find that string? Put all your application&#8217;s copy in a resource bundle, and you can not only make these changes with ease, you can deliver source code that anyone can modify easily. (Copy decks are a necessity when using translation services as well.)</p>
<p>You can use resource bundles to store configuration values such as paths, numbers, Boolean flags, debug mode, overrides, etc. You can use a resource bundle instead of a configuration file or static constants.</p>
<p>You can even use resource bundles to reskin applications. Flex lets you <em>parameterize embedded images</em> in resource bundles. Alternately, if you load images at runtime, you can parameterize those URLs in a resource bundle. So, if your code references resources instead of direct embeds, you can change the look of your app by swapping out the bundle with all the image embeds!</p>
<p>Even if you don&#8217;t use resource bundles for any sort of behavior, language, or appearance toggling in your application, bundles are a fantastic way to <em>separate code and content</em> and <em>organize related sets of content</em>.</p>
<p>In brief, resource bundles will make your life easier, your program modular, and your project structure tidy!</p>
<h3>What a World With Resource Bundles Looks Like</h3>
<p>Pretty soon I&#8217;ll show you the specifics of how to set up your project to use resource bundles. But before we get into technicalities, let me describe a few formats. There&#8217;s a few ways you can use resources, and there&#8217;s the property file format to cover as well.</p>
<p>Ok, again pardon the ultimately pedantic example, but let&#8217;s say you have a hello world app.</p>
<pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;&gt;
	&lt;mx:Label text=&quot;Hello, world!&quot;/&gt;
&lt;/mx:Application&gt;</pre>
<p>You clearly wrote this application for an English-speaking audience. And that bias exists in your code. It&#8217;s completely tied to your source file! Shame. If you wanted to write a Spanish version, you&#8217;d have to go right in and edit your source code:</p>
<pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;&gt;
	&lt;mx:Label text=&quot;Â¡Hola, mundo!&quot;/&gt;
&lt;/mx:Application&gt;</pre>
<p>But, with resource bundles, this is what the one, true, final and never-changing source code could look like:</p>
<pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;&gt;
	&lt;mx:Label text=&quot;<u>@Resource(key='message', bundle='copydeck')</u>&quot;/&gt;
&lt;/mx:Application&gt;
</pre>
<p>That&#8217;s one way, and indeed my favored way, of accessing resources from a resource bundle. This is going to look for the key <code>message</code> inside the bundle called <code>copydeck.properties</code>, and place its value in the <code>text</code> attribute of this Label instance, thus setting the text. Right now it looks like a lot <em>more</em> to type, but trust me, once you have a site or app with hundreds of lines of text, you are really going to appreciate how this makes your code concise and puts the text all together where it should be!</p>
<p>Note that you can use this <code>@Resource</code> directive in MXML in more places than just text attributes. You could use it to set tooltips, style properties, sizes, all kinds of things!</p>
<p>So let&#8217;s take a quick look at this outrageously simple properties file. This file format is really really easy.</p>
<pre>#locale/en_US/copydeck.properties
message=Hello, world!
message-size=30</pre>
<pre>#locale/es_MX/copydeck.properties
message=Â¡Hola, mundo!
message-size=40</pre>
<p>Here we see two copies of the properties file, made for two locales (American English and Mexican Spanish &#8212; locales are not just specific to the language but the region as well, but that&#8217;s another story). There&#8217;s pretty much only three things to know about properties files. </p>
<ul>
<li>Key <code>=</code> value. Do I need to explain this? Don&#8217;t sweat the whitespace.</li>
<li>Comments are whole lines that begin with <code>#</code>.</li>
<li>Properties are one line long unless you end the line with a backtick (<code>\</code>), in which case you can continue on the next line.</li>
</ul>
<p>In reality, there are alternate formats for the first two rules, but only use that if you <em>really have to be different</em>. There&#8217;s something to be said for the naming convention of the bundles. The directory structure I&#8217;ll explain a bit later, but know that en_US and es_MX are locale codes, combining a language code and a country code. The name of the file before its .properties extension is going to yield the bundle name itself.</p>
<p>Now, you can skip the whole step of specifying the bundle name by having one properties file per class file, and naming the properties file in parallel with the name of the class using it. If you do this, you can omit the <code>bundle='whatever'</code> attribute of the <code>@Resource</code> directive, but I advise against this. I advocate that you split up your resource bundles by purpose. For example, one recent project I worked on uses a bundle for copy and a bundle for skinning. Another recent project uses one bundle for copy and another for stylesheets.</p>
<p>So I hear you, you&#8217;re one of those hardcore doods who uses Flex but prefers to code in AS3. That&#8217;s cool, I&#8217;m down with that. Or maybe you just have something more interesting to do with those values coming out of resource bundles (configuration variables perhaps). There&#8217;s some nice ways of accessing values from resource bundles in code. Maybe looking at this will get you started:</p>
<pre>package
{
	import mx.containers.Canvas;
	import mx.controls.Label;

	<u>[ResourceBundle(&quot;copydeck&quot;)]</u>
	public class View extends Canvas
	{
		public function View()
		{
			super();
			var label:Label = new Label();
			label.text = <u>resourceManager.getString(&quot;copydeck&quot;, &quot;message&quot;)</u>;
			label.setStyle(&quot;fontSize&quot;, <u>resourceManager.getNumber(&quot;copydeck&quot;, &quot;message-size&quot;)</u>);
			addChild(label);
		}
	}
}</pre>
<p>If you&#8217;re in a class that doesn&#8217;t have its own reference to the ResourceManager, like Canvas here does, you can equally well use <code>ResourceManager.getInstance()</code>. Further, there are <a href="http://livedocs.adobe.com/flex/3/langref/index.html?mx/resources/IResourceManager.html&#038;mx/resources/class-list.html">lots of other cool typed accessor methods</a> you can use. Keep in mind that any bundles you reference in AS3 only must be explicitly included by using <code>[ResourceBundle]</code> metadata tags.</p>
<p>For more information about intermediate techniques like embedding assets and loading/swapping resource bundles at runtime, check out the very good <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=l10n_1.html">section on localization in the Livedocs</a>.</p>
<h3>The Petty Particulars of Putting it to Practice</h3>
<p>Now, I&#8217;m not going to leave you hanging with just some code examples. There&#8217;s a few things you need to know about structuring your Flex projects to take advantage of resource bundles. It&#8217;s really not that complicated, though, so not to worry!</p>
<p>First, you should pick a place for your resource bundles to live. Even if I&#8217;m only ever making apps for my United States English locale, I still like to make a <code>locale/en_US</code> folder, and place all my properties files inside there. I recommend you do the same.</p>
<p>Now here&#8217;s one tricky point. This directory must be one of the source directories in your Flex project. The compiler has to be able to crawl to those properties files, and it stays away from any place you haven&#8217;t specified in your build path. Again, even if I only have one locale ever, I like to keep this parameterized. Assuming you used the directory structure above, step one is to add the following directory to your build path:</p>
<pre>locale/{locale}</pre>
<p>The play-by-play, if you need it: right-click your project, choose Properties. Choose ActionScript Build Path on the left column, choose the Source Path tab, click Add Folder&#8230; and enter <code>locale/{locale}</code>.</p>
<p><img src="http://partlyhuman.com/articles/resource-bundles/build-path.gif" alt="screenshot"/><br clear="all"/></p>
<p>Finally, Flex Builder is going to get this locale variable from somewhere, and that&#8217;s from the arguments sent to mxmlc. Simply add the option</p>
<pre>-locale=en_US</pre>
<p>to your compiler arguments, or of course, substitute the locale in use. This value will replace the <code>{locale}</code> variable in the source path, and switch mxmlc to use the copies of the properties files in the correct location for the locale (or skin, or whatever&#8230;).</p>
<p>Again, the play-by-play. Right click your project, choose Properties. Choose ActionScript Compiler on the left column, and add the option just mentioned to any others that your project requires (if any).</p>
<p><img src="http://partlyhuman.com/articles/resource-bundles/compiler-arguments.gif" alt="screenshot"/></p>
<h3>Conclusion</h3>
<p>That&#8217;s all it should take to get you started with resource bundles! I hope that I&#8217;ve convinced you that resource bundles are a fun, safe, and effective way to separate your code and your content, whether your application will be localized and skinned or not! Separate your copy from your code. The next person to touch your code will thank you. If you use MXML with external CSS files <em>and</em> external resource bundles, you might achieve some sort of ultimate code separation enlightenment.</p>
<p>Did I miss anything? Run into any problems? Leave me a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://dispatchevent.org/roger/introduction-to-flex-resource-bundles/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

