<?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>Anselm Bradford &#187; Flex</title>
	<atom:link href="http://blog.anselmbradford.com/category/flash-platform/flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.anselmbradford.com</link>
	<description>wrangling the Internet's wildest</description>
	<lastBuildDate>Mon, 27 Jun 2011 19:17:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>July 2010 Auckland Flash Platform User Group Recap</title>
		<link>http://blog.anselmbradford.com/2010/07/08/july-2010-auckland-flash-platform-user-group-recap/</link>
		<comments>http://blog.anselmbradford.com/2010/07/08/july-2010-auckland-flash-platform-user-group-recap/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 12:03:56 +0000</pubDate>
		<dc:creator>Ans</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flash Platform]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=998</guid>
		<description><![CDATA[This is old news now, but as per my personal tradition I wanted to post a short recap of the Flash Platform User Group meetup that happened July 1. First to present was Michael Andrew, who demoed FlexPMD, an auditing tool for ActionScript/Flex projects. Essentially the tool provides a set of recommendations of how your [...]]]></description>
			<content:encoded><![CDATA[<p>This is old news now, but as per my personal tradition I wanted to post a short recap of the Flash Platform User Group meetup that happened July 1. </p>
<p>First to present was <a href="http://hazardmedia.co.nz" onclick="pageTracker._trackPageview('/outgoing/hazardmedia.co.nz?referer=');">Michael Andrew</a>, who demoed <a href="http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD" onclick="pageTracker._trackPageview('/outgoing/opensource.adobe.com/wiki/display/flexpmd/FlexPMD?referer=');">FlexPMD</a>, an auditing tool for ActionScript/Flex projects. Essentially the tool provides a set of recommendations of how your code could be improved/cleaned up. According to the Adobe Open Source page (linked above), the tool can be invoked from a number of different environments:</p>
<ul>
<li>The command line</li>
<li>Maven</li>
<li>Ant</li>
<li>Automator on Mac OS X</li>
<li>Eclipse</li>
<li>TextMate</li>
<li>FlashDevelop</li>
</ul>
<p>Oddly Flash is not listed, but perhaps Flash is beyond hope as a quality code IDE! <img src='http://blog.anselmbradford.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Second to present was <a href="http://greg-dove.com" onclick="pageTracker._trackPageview('/outgoing/greg-dove.com?referer=');">Greg Dove</a>, who live-coded a simple touch screen demo on a <a href="http://accessories.us.dell.com/sna/products/Displays/productdetail.aspx?c=us&#038;l=en&#038;cs=19&#038;sku=320-1172" onclick="pageTracker._trackPageview('/outgoing/accessories.us.dell.com/sna/products/Displays/productdetail.aspx?c=us_038_l=en_038_cs=19_038_sku=320-1172&amp;referer=');">Dell SX2210T</a>, an inexpensive touch screen display with two touch points capability. Greg also mentioned the best display he&#8217;d seen, the <a href="http://solutions.3m.com/wps/portal/3M/en_US/TouchSystems/TouchScreen/Solutions/TouchScreenDisplays/M2256pw/?WT.mc_id=www.3m.com/multitouch" onclick="pageTracker._trackPageview('/outgoing/solutions.3m.com/wps/portal/3M/en_US/TouchSystems/TouchScreen/Solutions/TouchScreenDisplays/M2256pw/?WT.mc_id=www.3m.com/multitouch&amp;referer=');">3M M2256PW</a>, which is capable of a whooping 20 simulations touch inputs (<a href="http://www.engadget.com/2010/01/07/3m-m2256pw-10-finger-multitouch-display-hands-on-with-video/" onclick="pageTracker._trackPageview('/outgoing/www.engadget.com/2010/01/07/3m-m2256pw-10-finger-multitouch-display-hands-on-with-video/?referer=');">view a demo on engadget</a>). Greg&#8217;s demo created a group of colored stars that could be resized and zoomed—both as a group and individually. The specific event Greg demoed was the recently added AS3 <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/TransformGestureEvent.html?allClasses=1" onclick="pageTracker._trackPageview('/outgoing/help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/TransformGestureEvent.html?allClasses=1&amp;referer=');">TransformGestureEvent</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.anselmbradford.com/2010/07/08/july-2010-auckland-flash-platform-user-group-recap/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>June 2010 Auckland Flash Platform User Group Recap</title>
		<link>http://blog.anselmbradford.com/2010/06/04/june-2010-auckland-flash-platform-user-group-recap/</link>
		<comments>http://blog.anselmbradford.com/2010/06/04/june-2010-auckland-flash-platform-user-group-recap/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 09:24:17 +0000</pubDate>
		<dc:creator>Ans</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash Platform]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=993</guid>
		<description><![CDATA[This month&#8217;s Auckland Flash Platform User Group Meetup began with a show-and-tell by the group&#8217;s usual host, VisFleet. CTO Aisha Fenton explained the business-side of VisFleet&#8217;s vWork software, a web-based task management application that allows a dispatcher to disseminate jobs to remote workers, who can log in via an iPhone app. Aisha provided an overview [...]]]></description>
			<content:encoded><![CDATA[<p>This month&#8217;s <a href="http://aucklandflash.eventbrite.com/" onclick="pageTracker._trackPageview('/outgoing/aucklandflash.eventbrite.com/?referer=');">Auckland Flash Platform User Group Meetup</a> began with a show-and-tell by the group&#8217;s usual host, <a href="http://www.visfleet.com" onclick="pageTracker._trackPageview('/outgoing/www.visfleet.com?referer=');">VisFleet</a>. CTO Aisha Fenton explained the business-side of VisFleet&#8217;s vWork software, a web-based task management application that allows a dispatcher to disseminate jobs to remote workers, who can log in via an iPhone app. Aisha provided an overview and demonstration of the software. <a href="http://twitter.com/squeedee" onclick="pageTracker._trackPageview('/outgoing/twitter.com/squeedee?referer=');">Rasheed Abdul-Aziz</a> then delved into the technology behind the application, which utilizes <a href="http://robotlegs.org" onclick="pageTracker._trackPageview('/outgoing/robotlegs.org?referer=');">Robotlegs</a> and the Flex framework. Rasheed mentioned <a href="http://hudson-ci.org" onclick="pageTracker._trackPageview('/outgoing/hudson-ci.org?referer=');">Hudson CI</a> for continuous integration, <a href="http://github.com" onclick="pageTracker._trackPageview('/outgoing/github.com?referer=');">GitHub</a> for source control and collaborative development, and <a href="http://www.charlesproxy.com" onclick="pageTracker._trackPageview('/outgoing/www.charlesproxy.com?referer=');">Charles Web Proxy</a>, a tool for analyzing HTTP data. Charles has some local fame, as it is developed by Auckland-based <a href="http://www.cactuslab.com/products/" onclick="pageTracker._trackPageview('/outgoing/www.cactuslab.com/products/?referer=');">Cactus Labs</a>.</p>
<p>After pizza <a href="http://twitter.com/love_jam" onclick="pageTracker._trackPageview('/outgoing/twitter.com/love_jam?referer=');">Jove Lam</a>, of TVNZ, demoed a Flash application he helped create for the Sony PS3 in-game browser to view on-demand content. Called <a href="http://tvnz.co.nz/ps3/video" onclick="pageTracker._trackPageview('/outgoing/tvnz.co.nz/ps3/video?referer=');">TVNZ OnDemand</a> the application featured an intuitive columnar layout for browsing content in different categories. On first impression it was not apparent that the application was essentially a full-screen Flash website. In his presentation, Jove mentioned the <a href="http://www.osmf.org" onclick="pageTracker._trackPageview('/outgoing/www.osmf.org?referer=');">Open Source Media Framework (OSMF)</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.anselmbradford.com/2010/06/04/june-2010-auckland-flash-platform-user-group-recap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>April 2010 Auckland Flash Platform User Group Recap</title>
		<link>http://blog.anselmbradford.com/2010/04/27/april-2010-auckland-flash-platform-user-group-recap/</link>
		<comments>http://blog.anselmbradford.com/2010/04/27/april-2010-auckland-flash-platform-user-group-recap/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 07:51:01 +0000</pubDate>
		<dc:creator>Ans</dc:creator>
				<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flash Platform]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=988</guid>
		<description><![CDATA[Last Thursday&#8217;s April meeting of the Auckland Flash Platform UG (once again held in the VisFleet offices) kicked off with UG manager Campbell Anderson demonstrating the new features of Flash Builder / Flex 4. Of particular note was Campbell&#8217;s demonstration of SourceMate, a Flash Builder companion that adds various code generation, refactoring, and metadata features. [...]]]></description>
			<content:encoded><![CDATA[<p>Last Thursday&#8217;s April meeting of the <a href="http://nzfpugauck.eventbrite.com/" onclick="pageTracker._trackPageview('/outgoing/nzfpugauck.eventbrite.com/?referer=');">Auckland Flash Platform UG</a> (once again held in the <a href="http://www.visfleet.com/" onclick="pageTracker._trackPageview('/outgoing/www.visfleet.com/?referer=');">VisFleet</a> offices) kicked off with UG manager <a href="http://xsive.co.nz" onclick="pageTracker._trackPageview('/outgoing/xsive.co.nz?referer=');">Campbell Anderson</a> demonstrating the new features of Flash Builder / Flex 4. Of particular note was Campbell&#8217;s demonstration of <a href="http://www.elementriver.com/sourcemate/" onclick="pageTracker._trackPageview('/outgoing/www.elementriver.com/sourcemate/?referer=');">SourceMate</a>, a Flash Builder companion that adds various code generation, refactoring, and metadata features.</p>
<p>Following pizza Vijay Anto from <a href="http://rad3.com" onclick="pageTracker._trackPageview('/outgoing/rad3.com?referer=');">Rad3</a> showed some examples of skinning the new Flash Builder component set, named <a href="http://help.adobe.com/en_US/flex/using/WSa122979b461972566d16c457125b7d3d121-7fff.html" onclick="pageTracker._trackPageview('/outgoing/help.adobe.com/en_US/flex/using/WSa122979b461972566d16c457125b7d3d121-7fff.html?referer=');">Spark</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.anselmbradford.com/2010/04/27/april-2010-auckland-flash-platform-user-group-recap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>March 2010 Auckland Flash Platform User Group Recap</title>
		<link>http://blog.anselmbradford.com/2010/03/18/march-2010-auckland-flash-platform-user-group-recap/</link>
		<comments>http://blog.anselmbradford.com/2010/03/18/march-2010-auckland-flash-platform-user-group-recap/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 12:09:46 +0000</pubDate>
		<dc:creator>Ans</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=984</guid>
		<description><![CDATA[Last night I attended the March meeting of the Auckland Flash Platform UG, held in the spacious offices of VisFleet. This was a great opportunity to freshen my knowledge on what&#8217;s happening in the Flash world. There were two presentations, with a break in the middle for the traditional developers meeting pastime of pizza and [...]]]></description>
			<content:encoded><![CDATA[<p>Last night I attended the March meeting of the <a href="http://aucknzfpug.eventbrite.com" onclick="pageTracker._trackPageview('/outgoing/aucknzfpug.eventbrite.com?referer=');">Auckland Flash Platform UG</a>, held in the spacious offices of <a href="http://www.visfleet.com" onclick="pageTracker._trackPageview('/outgoing/www.visfleet.com?referer=');">VisFleet</a>. This was a great opportunity to freshen my knowledge on what&#8217;s happening in the Flash world. There were two presentations, with a break in the middle for the traditional developers meeting pastime of pizza and beer. </p>
<p>First up was <a href="http://twitter.com/squeedee" onclick="pageTracker._trackPageview('/outgoing/twitter.com/squeedee?referer=');">Rasheed Abdul-Aziz</a>, Flex/Rails developer at VisFleet. Unfortunately I arrived a little late and missed the beginning of Rasheed&#8217;s presentation, but he covered a diversity of Rails and Flex development topics, including discussing refactoring and <a href="http://en.wikipedia.org/wiki/Domain-specific_language" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/Domain-specific_language?referer=');">Domain Specific Languages (DSL)</a>. In the later half of Rasheed&#8217;s presentation the focus turned to <a href="http://www.robotlegs.org" onclick="pageTracker._trackPageview('/outgoing/www.robotlegs.org?referer=');">Robotlegs</a>, a fairly recent (as to my knowledge) dependency injection ActionScript 3.0 framework that Rasheed swears by. I&#8217;m excited to find some time to try it out! Next, Rasheed demonstrated some of the benefits of using <a href="http://blogs.jetbrains.com/idea/2008/02/creating-flex-applications-with-intellij-idea/" onclick="pageTracker._trackPageview('/outgoing/blogs.jetbrains.com/idea/2008/02/creating-flex-applications-with-intellij-idea/?referer=');">IntelliJ IDEA</a> for Adobe Flex development, and gave it a glowing recommendation. Robert Penner&#8217;s <a href="http://github.com/robertpenner/as3-signals" onclick="pageTracker._trackPageview('/outgoing/github.com/robertpenner/as3-signals?referer=');">AS3Signals</a> (a new approach for AS3 events) was mentioned at the end during Q&amp;A.</p>
<p>Next <a href="http://vivace.co.nz" onclick="pageTracker._trackPageview('/outgoing/vivace.co.nz?referer=');">Vinnie Vivace</a> showed some simple 3D examples using <a href="http://away3d.com/away3d-lite-v1-0-fastest-and-smallest-3d-engine-in-flash" onclick="pageTracker._trackPageview('/outgoing/away3d.com/away3d-lite-v1-0-fastest-and-smallest-3d-engine-in-flash?referer=');">Away3DLite</a>, a slimmed-down version of <a href="http://away3d.com" onclick="pageTracker._trackPageview('/outgoing/away3d.com?referer=');">Away3D</a>. Vinnie also briefly showed a <a href="http://unity3d.com" onclick="pageTracker._trackPageview('/outgoing/unity3d.com?referer=');">Unity3D</a> example.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.anselmbradford.com/2010/03/18/march-2010-auckland-flash-platform-user-group-recap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What command-line tools are included in the Flex SDK?</title>
		<link>http://blog.anselmbradford.com/2009/01/07/what-command-line-tools-are-included-in-the-flex-sdk/</link>
		<comments>http://blog.anselmbradford.com/2009/01/07/what-command-line-tools-are-included-in-the-flex-sdk/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 07:27:28 +0000</pubDate>
		<dc:creator>Ans</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=551</guid>
		<description><![CDATA[Inside the bin directory of the Flex SDK you will find a long list of command-line tools. The following is an overview of what these tools do: AIR Development Tools aasdoc &#8211; For creating documentation of the classes in an AIR application acompc &#8211; For creating a SWC component (a reuseable library of source code [...]]]></description>
			<content:encoded><![CDATA[<p>Inside the <code>bin</code> directory of the Flex SDK you will find a long list of command-line tools. The following is an overview of what these tools do:</p>
<p><strong>AIR Development Tools</strong></p>
<ul>
<li><strong>aasdoc</strong> &#8211; For creating documentation of the classes in an AIR application</li>
<li><strong>acompc</strong> &#8211; For creating a SWC component (a reuseable library of source code for use in other projects) for AIR.</li>
<li><strong>adl</strong> <em>(not included in the Open Source Flex SDK)</em> &#8211; AIR Debug Launcher for debugging AIR applications. <a href="http://help.adobe.com/en_US/AIR/1.5/devappshtml/WS5b3ccc516d4fbf351e63e3d118666ade46-7fd7.html" onclick="pageTracker._trackPageview('/outgoing/help.adobe.com/en_US/AIR/1.5/devappshtml/WS5b3ccc516d4fbf351e63e3d118666ade46-7fd7.html?referer=');">Described here</a>.</li>
<li><strong>adt</strong> <em>(not included in the Open Source Flex SDK)</em> &#8211; A utility for packaging an application into an AIR installation file, which you can distribute to your users. An AIR installation file is an archive that contains all the application files.</li>
<li><strong>amxmlc</strong> &#8211; The compiler to use when building AIR applications, invokes the standard Flex mxmlc ActionScript and MXML compiler with an additional parameter, <code>+configname=air</code>.</li>
</ul>
<p><strong>Flex Development Tools</strong></p>
<ul>
<li><strong>asdoc</strong> &#8211; For creating documentation of MXML and/or ActionScript classes. </li>
<li><strong>compc</strong> &#8211; For creating SWC component libraries, reusable archives of source code that can be used in other projects. Makes distribution of a library of classes easy.</li>
<li><strong>copylocale</strong> &#8211; Utility for helping with localization in Flex Applications.</li>
<li><strong>digest</strong> &#8211; Used after SWCs have been optimized with <code>optimizer</code> to update SWC digest information.</li>
<li><strong>fcsh</strong> &#8211; The Flex Compiler Shell Utility provides a shell environment for compiling Flex applications, modules, and component libraries that is quicker than using mxmlc or compc.</li>
<li><strong>fdb</strong> &#8211; A command-line based debugger.</li>
<li><strong>jvm.config</strong> &#8211; Allows the custom configuration of the JVM (Java Virtual Machine) for more efficient use by the mxmlc and compc.</li>
<li><strong>mxmlc</strong> &#8211; The standard Flex compiler. Converts ActionScript and/or MXML code into a SWF that can run inside the Flash Player.</li>
<li><strong>optimizer</strong> &#8211; Removes debugging code and unnecessary metadata from a SWC library. This can be run after compc.</li>
</ul>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.anselmbradford.com/2009/01/07/what-command-line-tools-are-included-in-the-flex-sdk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Curious about Adobe Open Source? Get started with the Flex SDK on Mac OS X</title>
		<link>http://blog.anselmbradford.com/2009/01/06/curious-about-adobe-open-source-get-started-with-the-flex-sdk-on-mac-os-x/</link>
		<comments>http://blog.anselmbradford.com/2009/01/06/curious-about-adobe-open-source-get-started-with-the-flex-sdk-on-mac-os-x/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 13:12:50 +0000</pubDate>
		<dc:creator>Ans</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=548</guid>
		<description><![CDATA[How about creating a SWF that runs in the Adobe Flash Player without building it in the Flash or Flex Builder authoring environment, using tools that are free and open source? Ever since Adobe made the move from ActionScript 2.0 to 3.0 there has been a gem of a toolkit available that allows precisely that. [...]]]></description>
			<content:encoded><![CDATA[<p>How about creating a SWF that runs in the Adobe Flash Player without building it in the Flash or Flex Builder authoring environment, using tools that are free and open source? Ever since Adobe made the move from ActionScript 2.0 to 3.0 there has been a gem of a toolkit available that allows precisely that. The Flex SDK (Software Development Kit) allows developers to create SWFs from ActionScript and MXML source code, and with the right setup is not difficult to configure and use. </p>
<p>Housed at <a href="http://opensource.adobe.com" onclick="pageTracker._trackPageview('/outgoing/opensource.adobe.com?referer=');">Adobe Open Source</a>, the Flex SDK is available in two incarnations through the site: </p>
<ul>
<li><strong>The Open Source Flex SDK</strong> containing everything needed to create a functional application using ActionScript and/or MXML and the Flex framework. </li>
<li><strong>The Free Adobe Flex 3 SDK</strong> containing everything in the Open Source Flex SDK plus additional components such as advanced font encoders, tools for packaging Adobe AIR applications, and the Adobe Flash Player.
</li>
<h4>How to use the Flex SDK</h4>
<p>I have developed an Apache Ant build script that makes—after some configuration—the Flex SDK quite easy to use on Mac OS X. Here&#8217;s how to configure it:</p>
<ol>
<li><a href="http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK" onclick="pageTracker._trackPageview('/outgoing/opensource.adobe.com/wiki/display/flexsdk/Flex+SDK?referer=');">Download the latest Flex SDK</a> from Adobe Open Source. Rename the SDK folder <code>flex_sdk_3</code> and place it in <code>/Applications/</code> on your hard drive.</li>
<li>Locate <a href="http://ant.apache.org/" onclick="pageTracker._trackPageview('/outgoing/ant.apache.org/?referer=');">Apache Ant</a> on your system. Ant will already be installed if you have installed the Mac OS X Developer Tools (which are an optional install included with every version of OS X) or are running Leopard.
<p>Open Terminal and type:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">whereis</span> ant</pre></div></div>

<p>It should say something like</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ant</pre></div></div>

<p>If Ant is not installed, no path will be shown in Terminal. To install Ant I recommend using MacPorts, an excellent open source utility for managing unix tools on Mac OS X (follow these well written <a href="http://2tbsp.com/content/easily_manage_unix_packages_mac_macports,_formerly_darwinports" onclick="pageTracker._trackPageview('/outgoing/2tbsp.com/content/easily_manage_unix_packages_mac_macports_formerly_darwinports?referer=');">directions for installation</a>). If you are not comfortable using the Terminal, there is a GUI available for MacPorts called <a href="http://porticus.alittledrop.com" onclick="pageTracker._trackPageview('/outgoing/porticus.alittledrop.com?referer=');">Porticus</a>.</li>
<li>Copy the Flex Ant tasks to your Ant installation&#8217;s library. These will allow Ant to communicate with the major Flex SDK tools. To copy the tasks, first locate the Ant <code>lib</code> directory, which will be in Ant&#8217;s main installation folder. For example on Mac OS X 10.5 it appears at <code>usr/share/ant/lib</code>. Copy <code>/Applications/flex_sdk_3/ant/lib/flexTasks.jar</code> into this directory.
</li>
<li>
If you are an advanced user and would like to utilize Unit Testing using FlexUnit, <a href="http://weblogs.macromedia.com/pmartin/tooling/flexunit/FlexAntTasks.jar" onclick="pageTracker._trackPageview('/outgoing/weblogs.macromedia.com/pmartin/tooling/flexunit/FlexAntTasks.jar?referer=');">Download the FlexUnit Ant Tasks</a>. Place these in the Ant installation&#8217;s library folder as well. </p>
<p>(Note: The project template you will download from my site in the next step includes two SWCs for use with unit testing. For those that may be curious where these came from, here are the links to the original locations: <a href="http://opensource.adobe.com/wiki/display/flexunit/Downloads" onclick="pageTracker._trackPageview('/outgoing/opensource.adobe.com/wiki/display/flexunit/Downloads?referer=');">FlexUnit SWC library</a> and <a href="http://weblogs.macromedia.com/pmartin/tooling/flexunit/FlexUnitOptional-bin.zip" onclick="pageTracker._trackPageview('/outgoing/weblogs.macromedia.com/pmartin/tooling/flexunit/FlexUnitOptional-bin.zip?referer=');">FlexUnit Optional SWC library</a>)
</li>
<li><a href='/wp-content/uploads/2009/01/flexsdkprojecttemplate.zip'>Download the Flex SDK example application template</a> from my site. Unzip the archive and place the <code>FlexSDKProjectTemplate</code> folder on your desktop. Open the folder.</li>
<li>
Make a copy of  <code>build.properties.template</code> and rename it <code>build.properties</code>.
</li>
<li>
Open the <code>build.properties</code> file you just created and edit the <code>REQUIRED TOOL LOCATIONS</code> section to reflect the path to the Flex SDK, your preferred web browser, and the location of the Flash Player (which you will need to <a href="http://www.adobe.com/support/flashplayer/downloads.html" onclick="pageTracker._trackPageview('/outgoing/www.adobe.com/support/flashplayer/downloads.html?referer=');">download</a> if you have not already done so).
</li>
<li>Using Terminal navigate to the example application template. For example:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> Desktop<span style="color: #000000; font-weight: bold;">/</span>FlexSDKProjectTemplate<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>And then type the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ant run</pre></div></div>

<p>The sample application will launch, typing <code>ant usage</code> will show you what other options are available, such as creating documentation, SWCs, or launching the application in a web browser.
</li>
<li>
Lastly, to enable the <code>trace()</code> method so that it will work from your code when using the Flash debug player, create a textfile called <code>mm.cfg</code> and fill it with the following:</p>

<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">TraceOutPutFileName=flashlog.txt
ErrorReportingEnable=1
TraceOutputFileEnable=1
MaxWarnings=0</pre></div></div>

<p>Place this file at <code><br />
/Library/Application Support/Macromedia/mm.cfg</code>. Whenever you have a <code>trace("some text");</code> statement in your code, it will be written to:</p>

<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">/Users/[your username]/Library/Preferences/Macromedia/Flash Player/Logs/flashlog.txt</pre></div></div>

</li>
</ol>
<p>Please leave comments with any suggestions, problems, questions, etc. Enjoy!</p>
<h4>Troubleshooting</h4>
<p><b>Problem:</b> Running ASDoc produces: <code>Execute failed: java.io.IOException: /Applications/flex_sdk_3/bin/asdoc: cannot execute</code></p>
<p><b>Solution:</b> This mostly likely means the ASDoc script Ant uses is not set to be executable. Type the following in Terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>flex_sdk_3<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">chmod</span> +x asdoc</pre></div></div>

<p>The first line changes the directory to the one ASDoc resides in. The second line makes ASDoc executable.</p>
<p><b>Problem:</b> Running ASDoc produces: <code>exec returned: 255</code></p>
<p><b>Solution:</b> This mostly likely means the ASDoc script (which is just a text file) contains Window-style line endings. These will need to be converted to linux. </p>
<p>Install dos2unix using MacPorts and type the following in Terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>flex_sdk_3<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>
dos2unix asdoc</pre></div></div>

<p>This will turn off the executable bit in the permission tables, so you will have to re-enable that using the instructions in the first solution above.</p>
<p><b>Problem:</b> Running ASDoc produces: <code>Could not create toplevel.xml: /Applications/flex_sdk_3/asdoc/templates/asDocHelper: cannot execute</code></p>
<p><b>Solution:</b> This mostly likely means that a helper script used by ASDoc is not set to be executable. Type the following in Terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>flex_sdk_3<span style="color: #000000; font-weight: bold;">/</span>asdoc<span style="color: #000000; font-weight: bold;">/</span>templates<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">chmod</span> +x asDocHelper</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.anselmbradford.com/2009/01/06/curious-about-adobe-open-source-get-started-with-the-flex-sdk-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>What is Flex?</title>
		<link>http://blog.anselmbradford.com/2008/12/17/what-is-flex/</link>
		<comments>http://blog.anselmbradford.com/2008/12/17/what-is-flex/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 05:03:26 +0000</pubDate>
		<dc:creator>Ans</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=268</guid>
		<description><![CDATA[There was a question posted on the Flash Coders group on LinkedIn.com last night asking the simple question: &#8220;What is Flex?&#8221; I think reading about Flex for the first time can be a little confusing and intimidating, so here are some points to keep in mind: If you are coming from the Flash world, you can [...]]]></description>
			<content:encoded><![CDATA[<p>There was a question posted on the <a href="http://www.linkedin.com/groups?home=&amp;gid=119762&amp;goback=%2Ehom" onclick="pageTracker._trackPageview('/outgoing/www.linkedin.com/groups?home=_amp_gid=119762_amp_goback=_2Ehom&amp;referer=');">Flash Coders group on LinkedIn.com</a> last night asking the simple question: <b>&#8220;What is Flex?&#8221; </b></p>
<p>I think reading about Flex for the first time can be a little confusing and intimidating, so here are some points to keep in mind:</p>
<ul>
<li>If you are coming from the Flash world, you can think of Flex as building Flash applications using a set of pre-built components (think of what appears under the Components panel in the Flash authoring tool&#8217;s Window menu).</li>
<li><b>Flex</b> actually refers to a set of technologies, most notably what is known as the &#8220;Flex Framework,&#8221; a library of reusable components for rapidly creating Rich Internet Applications (RIAs) — that is applications on the web that behave like desktop computer applications. The components that make up the library are ActionScript class files (read up on Object-Oriented Programming if that is meaningless) that may be instantiated (created) using MXML or ActionScript. Interactivity between the components is generally provided by ActionScript, whether or not the application was built using MXML or not. All Flex Framework components reside under the &#8220;mx&#8221; package in the <a href="http://livedocs.adobe.com/flex/3/langref/" onclick="pageTracker._trackPageview('/outgoing/livedocs.adobe.com/flex/3/langref/?referer=');">Flex API reference</a> (which is a list of all the ActionScript classes you can use in your Flex projects, as well as those available to Flash projects).</li>
<li><b>MXML</b> is an XML markup language that makes the creation and layout of visual components of the Flex Framework more intuitive. The XML-style syntax of MXML makes it easy to see what visual components are nested within others. For example, a set of Buttons inside a Panel (a panel is like a window you would find within a desktop application, except it can not be dragged around the screen) may look like:

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"> <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Panel</span> title=<span style="color: #ff0000;">&quot;A Panel Example&quot;</span><span style="color: #7400FF;">&gt;</span></span>	
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;Button A&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;Button B&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;Button C&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Panel</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

</li>
<li><b><a href="http://www.adobe.com/products/flex/" onclick="pageTracker._trackPageview('/outgoing/www.adobe.com/products/flex/?referer=');">Flex Builder</a></b> is a commercial product by Adobe that offers time saving development tools such as a &#8220;Design&#8221; mode that streamlines the laying out of Graphical User Interfaces (GUIs). It is built upon an open source product called <a href="http://www.eclipse.org/" onclick="pageTracker._trackPageview('/outgoing/www.eclipse.org/?referer=');">Eclipse</a>, which is a software development tool that originally was for developing primarily Java-based software. In addition to Flex Builder, Adobe offers a &#8220;Flex Builder Plugin&#8221; for Eclipse, since the two products are so closely related.
 </li>
<li>The <b><a href="http://opensource.adobe.com/wiki/display/flexsdk/" onclick="pageTracker._trackPageview('/outgoing/opensource.adobe.com/wiki/display/flexsdk/?referer=');">Flex SDK</a></b> (Software Development Kit) is an open source package released by Adobe that includes the Flex Framework classes and a compiler (called mxmlc) used to turn ActionScript and MXML source code into a SWF that can then be run inside a webpage, etc. using the <a href="http://www.adobe.com/products/flashplayer/" onclick="pageTracker._trackPageview('/outgoing/www.adobe.com/products/flashplayer/?referer=');">Adobe Flash Player plugin</a>. Other tools are included in the Flex SDK such as a tool for creating documentation of the ActionScript class files (asDoc) and a tool for creating SWC files (called compc. SWC files are ActionScript libraries — essentially a bunch of ActionScript classes in a zipped archive, which make them portable for use in other projects).</li>
</ul>
<p>To see how all these Technologies interact together, check out the <a href="http://www.adobe.com/flashplatform/features/include/home/modal_01.png" onclick="pageTracker._trackPageview('/outgoing/www.adobe.com/flashplatform/features/include/home/modal_01.png?referer=');">Adobe Flash Platform diagram</a>. If you wish to learn Flex I would suggest first having a solid understanding of ActionScript 3.0 and Object-Oriented Programming. The most confusing part to me in the beginning was understanding that everything in a Flex project is ActionScript, even when laying something out using MXML. At the end of the day, there is an ActionScript class behind each component declared in MXML. MXML is just a convenience language, and as such is not necessary to developing Flex applications. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.anselmbradford.com/2008/12/17/what-is-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cairngorm versus PureMVC, the most basic example application!</title>
		<link>http://blog.anselmbradford.com/2008/12/05/cairngorm-versus-puremvc-the-most-basic-example/</link>
		<comments>http://blog.anselmbradford.com/2008/12/05/cairngorm-versus-puremvc-the-most-basic-example/#comments</comments>
		<pubDate>Sat, 06 Dec 2008 04:55:35 +0000</pubDate>
		<dc:creator>Ans</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=222</guid>
		<description><![CDATA[Awhile back when I was learning to use the Cairngorm framework, Nicolas Lierman had a very basic example of a Cairngorm application. At the time I was trying to slog through the Cairngorm Store example, racking my brains trying to figure out what was going on. I didn&#8217;t need such a complex example to start [...]]]></description>
			<content:encoded><![CDATA[<p>Awhile back when I was learning to use the <a href="http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm" onclick="pageTracker._trackPageview('/outgoing/opensource.adobe.com/wiki/display/cairngorm/Cairngorm?referer=');">Cairngorm framework</a>, <a href="http://www.aboutnico.be" onclick="pageTracker._trackPageview('/outgoing/www.aboutnico.be?referer=');">Nicolas Lierman</a> had a very basic example of a Cairngorm application. At the time I was trying to slog through the Cairngorm Store example, racking my brains trying to figure out what was going on. I didn&#8217;t need such a complex example to start from, just something extremely simple that would compile, and I could build from there. Looking at Nicolas&#8217; example application was an &#8216;ah ha&#8217; moment when it all came together in my mind. Now I have been learning the <a href="http://puremvc.org" onclick="pageTracker._trackPageview('/outgoing/puremvc.org?referer=');">PureMVC framework</a> and would like to resurrect a slightly modified version of that Cairngorm example (Nicolas&#8217; used WebService, this uses HTTPService) side-by-side with the same example written in PureMVC. If you are trying to learn either of these frameworks, reference the <a href="http://www.cairngormdocs.org/cairngormDiagram/index.html" onclick="pageTracker._trackPageview('/outgoing/www.cairngormdocs.org/cairngormDiagram/index.html?referer=');">Cairngorm Explorer</a> and/or the <a href="http://puremvc.org/component/option,com_wrapper/Itemid,34/" onclick="pageTracker._trackPageview('/outgoing/puremvc.org/component/option_com_wrapper/Itemid_34/?referer=');">PureMVC Conceptual Diagram</a> and build on these examples. I hope they will help you as much as they helped me to learn the framework&#8217;s architecture.</p>
<p>Below is the example application written using the Cairngorm framework. Since the PureMVC example looks and functions exactly the same I will omit it. As you can see it is very simple. Type in your name and it sends it to the server and returns a message.</p>
<p><span style="color: #551a8b; text-decoration: underline;">
<object width="450" height="210">
<param name="movie" value="/wp-content/uploads/2008/12/cairngormexample.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#FFFFFF"></param>
<param name="allowScriptAccess" value="always"></param>
<embed type="application/x-shockwave-flash" width="450" height="210" src="/wp-content/uploads/2008/12/cairngormexample.swf" quality="high" bgcolor="#FFFFFF" wmode="window" menu="false" ></embed>
</object>
<br />
</span></p>
<p>The php backend is extremely simple:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Hello &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;!&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><a href='http://blog.anselmbradford.com/wp-content/uploads/2008/12/as3_framework_examples.zip'>Download Source Here</a> (You will also need to download <a href="http://opensource.adobe.com/wiki/display/cairngorm/Downloads" onclick="pageTracker._trackPageview('/outgoing/opensource.adobe.com/wiki/display/cairngorm/Downloads?referer=');">Cairngorm</a> and <a href="http://trac.puremvc.org/PureMVC_AS3/" onclick="pageTracker._trackPageview('/outgoing/trac.puremvc.org/PureMVC_AS3/?referer=');">PureMVC</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.anselmbradford.com/2008/12/05/cairngorm-versus-puremvc-the-most-basic-example/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>After creationComplete a Flex component&#8217;s stage property is&#8230; what? null?</title>
		<link>http://blog.anselmbradford.com/2008/08/22/after-creationcomplete-a-flex-components-stage-property-is-what-null/</link>
		<comments>http://blog.anselmbradford.com/2008/08/22/after-creationcomplete-a-flex-components-stage-property-is-what-null/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 07:44:04 +0000</pubDate>
		<dc:creator>Ans</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=34</guid>
		<description><![CDATA[When creating a custom Flex component, it may be desirable to access the stage when initializing the component. However, as stated in the documentation, the stage property of a DisplayObject only becomes accessible (that is, does not appear as null) when the display object has been added to the display list. It would seem intuitive [...]]]></description>
			<content:encoded><![CDATA[<p>When creating a custom Flex component, it may be desirable to access the stage when initializing the component. However, as stated in the documentation, the <a href="http://livedocs.adobe.com/flex/201/langref/flash/display/DisplayObject.html#stage" onclick="pageTracker._trackPageview('/outgoing/livedocs.adobe.com/flex/201/langref/flash/display/DisplayObject.html_stage?referer=');"><code>stage</code></a> property of a <code>DisplayObject</code> only becomes accessible (that is, does not appear as <code>null</code>) when the display object has been added to the display list. It would seem intuitive then that the <code>stage</code> property should have a value when the <a href="http://livedocs.adobe.com/flex/201/langref/flash/display/DisplayObject.html#event:added" onclick="pageTracker._trackPageview('/outgoing/livedocs.adobe.com/flex/201/langref/flash/display/DisplayObject.html_event_added?referer=');"><code>added</code></a> or the more Flex-specific <code>UIComponent</code>&#8216;s <a href="http://livedocs.adobe.com/flex/201/langref/mx/core/UIComponent.html#event:creationComplete" onclick="pageTracker._trackPageview('/outgoing/livedocs.adobe.com/flex/201/langref/mx/core/UIComponent.html_event_creationComplete?referer=');"><code>creationComplete</code></a> event has fired. However, the <code>stage</code> property only acquires a value after the display object has been added to the stage&#8217;s display list, not just any display list. For example, when the component is added to its parent&#8217;s display list the <code>added</code> event is triggered, but the <code>stage</code> property would still be <code>null</code> as the parent had yet to be added to the stage&#8217;s display list.</p>
<p>Thankfully buried somewhere in Flex&#8217;s vast API there is an event for every need, or one would hope. And with the update from Flex 2 to Flex 2.0.1 a new event was added to <code>DisplayObject</code> called <a href="http://livedocs.adobe.com/flex/201/langref/flash/display/DisplayObject.html#event:addedToStage" onclick="pageTracker._trackPageview('/outgoing/livedocs.adobe.com/flex/201/langref/flash/display/DisplayObject.html_event_addedToStage?referer=');"><code>addedToStage</code></a>, which consistently provides a way to run initialization code that depends on the stage, such as references to <code>stage.stageWidth</code>, etc.</p>
<p>Consider the following component, which traces out the firing of certain initialization events:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package com.<span style="color: #006600;">anselmbradford</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">core</span>.<span style="color: #006600;">UIComponent</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
	<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">events</span>.<span style="color: #006600;">FlexEvent</span>;
	<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">core</span>.<span style="color: #006600;">Application</span>;
&nbsp;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Component <span style="color: #0066CC;">extends</span> UIComponent 
	<span style="color: #66cc66;">&#123;</span>		
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Component<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> 
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">this</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> Event.<span style="color: #006600;">ADDED</span> , addedHandler <span style="color: #66cc66;">&#41;</span>;			
			<span style="color: #0066CC;">this</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> Event.<span style="color: #006600;">ADDED_TO_STAGE</span> , addedToStageHandler <span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">this</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> FlexEvent.<span style="color: #006600;">CREATION_COMPLETE</span> , creationCompleteHandler <span style="color: #66cc66;">&#41;</span>;			
			Application.<span style="color: #006600;">application</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> FlexEvent.<span style="color: #006600;">APPLICATION_COMPLETE</span> , applicationCompleteHandler <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> addedHandler<span style="color: #66cc66;">&#40;</span> event:Event <span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span> , <span style="color: #ff0000;">&quot;addedHandler called&quot;</span> , <span style="color: #0066CC;">stage</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> addedToStageHandler<span style="color: #66cc66;">&#40;</span> event:Event <span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span> , <span style="color: #ff0000;">&quot;addedToStageHandler called&quot;</span> , <span style="color: #0066CC;">stage</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> creationCompleteHandler<span style="color: #66cc66;">&#40;</span> event:FlexEvent <span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span> , <span style="color: #ff0000;">&quot;creationCompleteHandler called&quot;</span> , <span style="color: #0066CC;">stage</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> applicationCompleteHandler<span style="color: #66cc66;">&#40;</span> event:Event <span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span> , <span style="color: #ff0000;">&quot;applicationCompleteHandler called&quot;</span> , <span style="color: #0066CC;">stage</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>A really nice thing about Flex is that this component could either be instantiated via MXML or ActionScript syntax, since at compile time it all becomes ActionScript anyway. If the position of this component within the layout is important, MXML would be the preferred method. </p>
<p>Instantiating the component with MXML:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span></span>
<span style="color: #000000;">xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">xmlns:ab=<span style="color: #ff0000;">&quot;com.anselmbradford.*&quot;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&gt;</span></span>
     <span style="color: #000000;"><span style="color: #7400FF;">&lt;ab:Component</span><span style="color: #7400FF;">/&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Instantiating the component with ActionScript:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span></span>
<span style="color: #000000;">xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">applicationComplete=<span style="color: #ff0000;">&quot;init()&quot;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&gt;</span></span>
      <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
&nbsp;
<span style="color: #339933;">            import com.anselmbradford.Component;</span>
&nbsp;
<span style="color: #339933;">            private function init() : void</span>
<span style="color: #339933;">            {</span>
<span style="color: #339933;">            	this.addChild( new Component() );</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">      &lt;/mx:Script&gt;</span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Now take a look at the difference in how the same component&#8217;s events are triggering by instantiating the component in MXML versus ActionScript:</p>
<p>Output via MXML instantiation:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Main0.Component4 addedHandler called null
Main0.Component4 creationCompleteHandler called null
Main0.Component4 addedToStageHandler called [object Stage]
Main0.Component4 applicationCompleteHandler called [object Stage]</pre></div></div>

<p>Output via ActionScript instantiation:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Main0.Component7 addedHandler called [object Stage]
Main0.Component7 addedToStageHandler called [object Stage]
Main0.Component7 creationCompleteHandler called [object Stage]</pre></div></div>

<p>You&#8217;ll notice the only event with a consistently initialized <code>stage</code> property across these two methods of instantiating the component is, not surprisingly, the <code>addedToStage</code> event. The <code>applicationComplete</code> event does not even fire in the ActionScript instantiation example, because the instantiation occurred within the handler for the <code>applicationComplete</code> event of the main application MXML file, and therefore the component was constructed after that event had already fired. </p>
<p><strong>The bottom line: </strong>listen for the <code>addedToStage</code> event if you want to be sure the <code>stage</code> property has a value when it is accessed.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.anselmbradford.com/2008/08/22/after-creationcomplete-a-flex-components-stage-property-is-what-null/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>2008 Spring &lt;br/&gt; Conference video player online</title>
		<link>http://blog.anselmbradford.com/2008/08/20/2008-spring-br-conference-video-player-online/</link>
		<comments>http://blog.anselmbradford.com/2008/08/20/2008-spring-br-conference-video-player-online/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 06:49:51 +0000</pubDate>
		<dc:creator>Ans</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=29</guid>
		<description><![CDATA[I wrapped the great open source Flex FX Video Player in a Cairngorm web app and voila&#8230; a video player for the Spring &#60;br/&#62; conference videos.]]></description>
			<content:encoded><![CDATA[<p>I wrapped the great open source Flex <a href="http://www.fxcomponents.com/?p=29" onclick="pageTracker._trackPageview('/outgoing/www.fxcomponents.com/?p=29&amp;referer=');">FX Video Player</a> in a Cairngorm web app and voila&#8230; a video player for <a href="http://streaming.cns.ohiou.edu/sbconference/index.htm" onclick="pageTracker._trackPageview('/outgoing/streaming.cns.ohiou.edu/sbconference/index.htm?referer=');">the Spring &lt;br/&gt; conference videos</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.anselmbradford.com/2008/08/20/2008-spring-br-conference-video-player-online/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

