<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Clockwork Objects</title><link>http://clockobj.co.uk</link><description>User Experience &amp; Web Design and Development</description><language>en</language><generator>http://wordpress.org/?v=2.5.1</generator><geo:lat>50.2638</geo:lat><geo:long>-5.059</geo:long><image><link>http://clockobj.co.uk/</link><url>http://clockobj.co.uk/images/cwo-mid.png</url><title>Clockwork Objects</title></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/miletbaker" type="application/rss+xml" /><feedburner:emailServiceId>753916</feedburner:emailServiceId><feedburner:feedburnerHostname>http://www.feedburner.com</feedburner:feedburnerHostname><item><title>Changing Flex3 ScrollBar maxScrollPosition at runtime</title><link>http://feeds.feedburner.com/~r/miletbaker/~3/285551804/</link><category>Uncategorized</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jon</dc:creator><pubDate>Wed, 07 May 2008 13:16:07 -0500</pubDate><guid isPermaLink="false">http://clockobj.co.uk/?p=91</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>A quick tip if you have a dynamic scroll bar and want to bind it&#8217;s maxScrollPosition to a value at runtime unfortunately you can&#8217;t use the MXML binding, i.e. maxScrollPosition={value}.</p>
<p>Alternatively you need to set the value programatically in an event handler, AND importantly call updateDisplayList() on the scrollbar. i.e.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="actionscript"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>mx:Application xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout=<span style="color: #ff0000;">&quot;vertical&quot;</span><span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;</span>mx:Script<span style="color: #66cc66;">&gt;</span>
		<span style="color: #66cc66;">&lt;!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span>
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> handleSlideChange<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #0066CC;">scroll</span>.<span style="color: #006600;">maxScrollPosition</span> = slider.<span style="color: #006600;">value</span>;
				<span style="color: #0066CC;">scroll</span>.<span style="color: #006600;">invalidateDisplayList</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;/</span>mx:Script<span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;</span>mx:HSlider minimum=<span style="color: #ff0000;">&quot;1&quot;</span> maximum=<span style="color: #ff0000;">&quot;10&quot;</span> value=<span style="color: #ff0000;">&quot;1&quot;</span> tickInterval=<span style="color: #ff0000;">&quot;1&quot;</span>
		liveDragging=<span style="color: #ff0000;">&quot;true&quot;</span> id=<span style="color: #ff0000;">&quot;slider&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;50%&quot;</span>
		change=<span style="color: #ff0000;">&quot;handleSlideChange()&quot;</span> snapInterval=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #66cc66;">/&gt;</span>
&nbsp;
	<span style="color: #66cc66;">&lt;</span>mx:HScrollBar scrollPosition=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;50%&quot;</span> id=<span style="color: #ff0000;">&quot;scroll&quot;</span> pageSize=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #66cc66;">/&gt;</span>
<span style="color: #66cc66;">&lt;/</span>mx:Application<span style="color: #66cc66;">&gt;</span></pre></td></tr></table></div>

<p><script src="http://clockobj.co.uk/wp-content/uploads/2008/05/ac_oetags.js" language="javascript"></script><br />
<script language="JavaScript" type="text/javascript">
<!--
		AC_FL_RunContent(
					"src", "http://clockobj.co.uk/wp-content/uploads/2008/05/scrollbartest",
					"width", "500",
					"height", "100",
					"align", "middle",
					"id", "ScrollBarTest",
					"quality", "high",
					"bgcolor", "#869ca7",
					"name", "ScrollBarTest",
					"allowScriptAccess","sameDomain",
					"type", "application/x-shockwave-flash",
					"pluginspage", "http://www.adobe.com/go/getflashplayer"
	);
// -->
</script><br />
<noscript><br />
	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"<br />
			id="ScrollBarTest" width="500" height="100"<br />
			codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"></p>
<param name="movie" value="ScrollBarTest.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="sameDomain" />
			<embed src="http://clockobj.co.uk/wp-content/uploads/2008/05/scrollbartest.swf" quality="high" bgcolor="#869ca7"<br />
				width="500" height="100" name="ScrollBarTest" align="middle"<br />
				play="true"<br />
				loop="false"<br />
				quality="high"<br />
				allowScriptAccess="sameDomain"<br />
				type="application/x-shockwave-flash"<br />
				pluginspage="http://www.adobe.com/go/getflashplayer"><br />
			</embed><br />
	</object><br />
</noscript></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/miletbaker?a=7NpNoH"><img src="http://feeds.feedburner.com/~f/miletbaker?i=7NpNoH" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=4LE13h"><img src="http://feeds.feedburner.com/~f/miletbaker?i=4LE13h" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=mzJRWH"><img src="http://feeds.feedburner.com/~f/miletbaker?i=mzJRWH" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=EeVy6h"><img src="http://feeds.feedburner.com/~f/miletbaker?i=EeVy6h" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=VRDnBH"><img src="http://feeds.feedburner.com/~f/miletbaker?i=VRDnBH" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=5hBJph"><img src="http://feeds.feedburner.com/~f/miletbaker?i=5hBJph" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=8arYkH"><img src="http://feeds.feedburner.com/~f/miletbaker?i=8arYkH" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/miletbaker/~4/285551804" height="1" width="1"/>]]></content:encoded><description>A quick tip if you have a dynamic scroll bar and want to bind it&amp;#8217;s maxScrollPosition to a value at runtime unfortunately you can&amp;#8217;t use the MXML binding, i.e. maxScrollPosition={value}.
Alternatively you need to set the value programatically in an event handler, AND importantly call updateDisplayList() on the scrollbar. i.e.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
&amp;#60;?xml version=&amp;#34;1.0&amp;#34; encoding=&amp;#34;utf-8&amp;#34;?&amp;#62;
&amp;#60;mx:Application xmlns:mx=&amp;#34;http://www.adobe.com/2006/mxml&amp;#34; layout=&amp;#34;vertical&amp;#34;&amp;#62;
	&amp;#60;mx:Script&amp;#62;
		&amp;#60;!&amp;#91;CDATA&amp;#91;
			private function handleSlideChange&amp;#40;&amp;#41;:void [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://clockobj.co.uk/2008/05/07/changing-flex3-scrollbar-maxscrollposition-at-runtime/feed/</wfw:commentRss><feedburner:origLink>http://clockobj.co.uk/2008/05/07/changing-flex3-scrollbar-maxscrollposition-at-runtime/</feedburner:origLink></item><item><title>Updated WP-Flickr</title><link>http://feeds.feedburner.com/~r/miletbaker/~3/279698702/</link><category>Misc..</category><category>php</category><category>wp-flickr</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jon</dc:creator><pubDate>Mon, 28 Apr 2008 18:20:57 -0500</pubDate><guid isPermaLink="false">http://clockobj.co.uk/?p=88</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Just to let you all know I have updated WP-Flcikr, making it compatible with WordPress 2.5</p>
<p>As part of the update, I have fixed the following:</p>
<ul>
<li>Compatibility with WordPress 2.5</li>
<li>Issue where users without curl installed would get an error authenticating</li>
<li>Updated the style to match WordPress 2.5</li>
<li>AJAX enabled the plugin to stop the page refresh (which ws incompatible with WordPress 2.5) when switching Photo Sets on the write/edit post page</li>
</ul>
<p><img src="http://farm4.static.flickr.com/3214/2449667775_76fc86e339.jpg" alt="wp-flickr" /></p>
<p>If you are using WordPress 2.5, you can automatically upgrade to the latest version from the plugins page. If you are not already using WP-Flickr, you can download it here <a href="http://wordpress.org/extend/plugins/wp-flickr/">http://wordpress.org/extend/plugins/wp-flickr/</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/miletbaker?a=htdMWG"><img src="http://feeds.feedburner.com/~f/miletbaker?i=htdMWG" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=2UKDVg"><img src="http://feeds.feedburner.com/~f/miletbaker?i=2UKDVg" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=XfDRMG"><img src="http://feeds.feedburner.com/~f/miletbaker?i=XfDRMG" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=dvpzwg"><img src="http://feeds.feedburner.com/~f/miletbaker?i=dvpzwg" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=lHGEtG"><img src="http://feeds.feedburner.com/~f/miletbaker?i=lHGEtG" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=HkjDFg"><img src="http://feeds.feedburner.com/~f/miletbaker?i=HkjDFg" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=BIMdSG"><img src="http://feeds.feedburner.com/~f/miletbaker?i=BIMdSG" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/miletbaker/~4/279698702" height="1" width="1"/>]]></content:encoded><description>Just to let you all know I have updated WP-Flcikr, making it compatible with WordPress 2.5
As part of the update, I have fixed the following:

Compatibility with WordPress 2.5
Issue where users without curl installed would get an error authenticating
Updated the style to match WordPress 2.5
AJAX enabled the plugin to stop the page refresh (which ws incompatible [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://clockobj.co.uk/2008/04/28/updated-wp-flickr/feed/</wfw:commentRss><feedburner:origLink>http://clockobj.co.uk/2008/04/28/updated-wp-flickr/</feedburner:origLink></item><item><title>Scaling up EasyMVC as your Flex application grows (Part 2: Services)</title><link>http://feeds.feedburner.com/~r/miletbaker/~3/245746328/</link><category>AIR</category><category>Flex</category><category>as3</category><category>ActionScript</category><category>easymvc</category><category>RIAs</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jon</dc:creator><pubDate>Tue, 04 Mar 2008 16:05:27 -0600</pubDate><guid isPermaLink="false">http://clockobj.co.uk/2008/03/04/scaling-up-easymvc-as-your-flex-application-grows-part-2-services/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>EasyMVC is a lightweight architecture process for Adobe Flex and AIR first proposed by <a href="http://www.tombray.com/">Tom Bray</a> of <a href="http://searchcoders.com/">SearchCoders</a> and <a href="http://www.chatopica.com">Chatopica</a>. This is the second part covering Service calls, of a two part article on how to take that architecture and scale up to a simplified cairngorm style architecture when you outgrown EasyMVC.</p>
<p><a href="http://clockobj.co.uk/2007/10/17/simplified-cairngorm-easy-mvc-for-adobe-flex/">Click here to read an introduction on EasyMVC</a><a href="http://clockobj.co.uk/2008/01/21/scaling-up-easymvc-as-your-flex-application-grows-part-1/"><br />
Click here to read Scaling up EasyMVC part 1.</a></p>
<p>Firstly I would like to add some clarification as to the motivation for these articles. I have had a few emails asking what the point of these articles are as I am just recreating Cairngorm. I hope these articles will satisfy two goals. Firstly having discussed EasyMVC and evangelised about it a little I feel I should offer a way to scale this up when your application grows, if not you could end up with a huge EasyMVC controller class that has 30 or so event handlers in addition to service calls etc which will get unmanageable, especially in a team of developers. Secondly I hope these articles will give an insight into how Cairngorm works from a simplified perspective. Cairngorm is an excellent architecture but it is intimidating for beginners and intermediates alike. This Scaled up EasyMVC architecture provides a simplified lightweight version of Cairngorm and also provides an upgrade path for EasyMVC adopters.<br />
In the first article we looked at how we can borrow the command design pattern (as used in Cairngorm) to split out our centralised event handlers into separate classes or commands. Firstly this makes your code more organised and easier to locate specific functionality when you application grows but also provides you with the basis for the next step in handling remote calls to web services, be that SOAP, REST or AMF services.</p>
<p><span id="more-83"></span>At this point we are going to borrow <a href="http://www.darronschall.com/weblog/archives/000234.cfm">a technique used by Darren Schall</a>, where he suggests using the built in IResponder interface to handle web service responses.</p>
<p>The IResponder interface defines that we should create two event handlers, one called result which takes one parameter of type Event (usually a ResultEvent) and one event handler called fault which takes one parameter of type Event (usually a FaultEvent).</p>
<p>What we want, is for commands to handle our service calls. In the first article we created an interface for our commands called ICommandEMVC. Here we ensured all commands we created has an execute(e:Event) function which would be called as the event handler for all our centralised events.<br />
What we will now do is create a new Interface called IResponderCommandEMVC which will implement both the ICommandEMVC that we created and Flex’s build in IResponder interface. This will then give us a class definition that has an execute event handler that is called when we fire off a EasyMVC event that is handled by our central event handler, and result() and fault() event handlers that handles the results of our service call. We do this as follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="actionscript">package com.<span style="color: #006600;">triggersoft</span>.<span style="color: #006600;">core</span>.<span style="color: #006600;">emvc</span>
&nbsp;
<span style="color: #66cc66;">&#123;</span>
&nbsp;
  <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">rpc</span>.<span style="color: #006600;">IResponder</span>;
&nbsp;
  <span style="color: #0066CC;">public</span> <span style="color: #0066CC;">interface</span> IResponderCommandEMVC <span style="color: #0066CC;">extends</span> IResponder, ICommandEMVC
&nbsp;
  <span style="color: #66cc66;">&#123;</span>
&nbsp;
  <span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>We can now write command classes that implement IResponderCommandEMVC. We could implement the code to call our web service here but then we may duplicate effort whenever we need more than one command to call the same web service. So I like to create the equivalent of Cairngorm’s service locator or more simply a singleton that proxies my service calls.</p>
<p>So for example, if we had a SOAP web service located on our localhost i.e. http://localhost/Service?WSDL which had an authenticate command that took a username and password parameter (and this is a simple example) we could do the following</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
</pre></td><td class="code"><pre class="actionscript">package com.<span style="color: #006600;">triggersoft</span>.<span style="color: #006600;">project</span>.<span style="color: #006600;">controller</span>.<span style="color: #006600;">services</span>
&nbsp;
<span style="color: #66cc66;">&#123;</span>
&nbsp;
  <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MyService <span style="color: #66cc66;">&#123;</span>
&nbsp;
    <span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">var</span> _instance:MyService;
&nbsp;
    <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> service:WebService;    <span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> getInstance<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
      <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>_instance == <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
      _instance = <span style="color: #000000; font-weight: bold;">new</span> RespondentWS<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
      <span style="color: #66cc66;">&#125;</span>
&nbsp;
      <span style="color: #b1b100;">return</span> _instance;
&nbsp;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> MyService:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
      service = <span style="color: #000000; font-weight: bold;">new</span> WebService<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
      service.<span style="color: #006600;">loadWSDL</span><span style="color: #66cc66;">&#40;</span>“http:<span style="color: #808080; font-style: italic;">//locahost/Service?WSDL”);</span>
&nbsp;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> authenticate<span style="color: #66cc66;">&#40;</span>responder:IResponder, username:<span style="color: #0066CC;">String</span>, <span style="color: #0066CC;">password</span>:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
      <span style="color: #000000; font-weight: bold;">var</span> at:AsynToken = service.<span style="color: #006600;">authenticate</span><span style="color: #66cc66;">&#40;</span>username, <span style="color: #0066CC;">password</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
      at.<span style="color: #006600;">addResponder</span><span style="color: #66cc66;">&#40;</span>responder<span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
  <span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>This means that we can call the authenticate method on this service from any command using the MyService.getInstance.authenticate() method and pass in a responder, the username and password.</p>
<p>As our command implemented the IResponderCommandEMVC interface, which in turn implements the IResponder interface we can pass the command as a web service responder, so if we had AuthenticateCommand which was registered with our Controller (See part I) that listened to a custom event that stored the username and password. We could write the following command</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="actionscript">package com.<span style="color: #006600;">triggersoft</span>.<span style="color: #006600;">project</span>.<span style="color: #006600;">controller</span>.<span style="color: #006600;">commands</span>
&nbsp;
<span style="color: #66cc66;">&#123;</span>
&nbsp;
  <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> AuthenticateCommand <span style="color: #66cc66;">&#123;</span>    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> execute<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
      <span style="color: #000000; font-weight: bold;">var</span> ae:AuthenticationEvent = AuthenticationEvent <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
      MyService.<span style="color: #006600;">getInstance</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">Authenticate</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, ae.<span style="color: #006600;">username</span>, ae.<span style="color: #0066CC;">password</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> result<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
      <span style="color: #808080; font-style: italic;">//handle web service result</span>
&nbsp;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> fault<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
      <span style="color: #808080; font-style: italic;">//handle web service error</span>
&nbsp;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>As you can see we can easily scale up EasyMVC to a lightweight version of Cairngorm as your application grows.  In reading these articles, I hope you have gained an insight into the benefits of using a formal architecture such as this and also demystified the Cairngorm framework. EasyMVC does not have all the feature of Cairngorm but it is a light weight alternative that suits many projects from small to large.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/miletbaker?a=8sSMAOF"><img src="http://feeds.feedburner.com/~f/miletbaker?i=8sSMAOF" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=rkD9rZf"><img src="http://feeds.feedburner.com/~f/miletbaker?i=rkD9rZf" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=1aTYZPF"><img src="http://feeds.feedburner.com/~f/miletbaker?i=1aTYZPF" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=FkfPWJf"><img src="http://feeds.feedburner.com/~f/miletbaker?i=FkfPWJf" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=tTDr23F"><img src="http://feeds.feedburner.com/~f/miletbaker?i=tTDr23F" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=H9Rmtuf"><img src="http://feeds.feedburner.com/~f/miletbaker?i=H9Rmtuf" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=XHdMGQF"><img src="http://feeds.feedburner.com/~f/miletbaker?i=XHdMGQF" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/miletbaker/~4/245746328" height="1" width="1"/>]]></content:encoded><description>EasyMVC is a lightweight architecture process for Adobe Flex and AIR first proposed by Tom Bray of SearchCoders and Chatopica. This is the second part covering Service calls, of a two part article on how to take that architecture and scale up to a simplified cairngorm style architecture when you outgrown EasyMVC.
Click here to read [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://clockobj.co.uk/2008/03/04/scaling-up-easymvc-as-your-flex-application-grows-part-2-services/feed/</wfw:commentRss><feedburner:origLink>http://clockobj.co.uk/2008/03/04/scaling-up-easymvc-as-your-flex-application-grows-part-2-services/</feedburner:origLink></item><item><title>Adobe Flex: Styling the DataGrid header separators</title><link>http://feeds.feedburner.com/~r/miletbaker/~3/225204913/</link><category>AIR</category><category>Flex</category><category>as3</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jon</dc:creator><pubDate>Tue, 29 Jan 2008 06:11:59 -0600</pubDate><guid isPermaLink="false">http://clockobj.co.uk/2008/01/29/adobe-flex-styling-the-datagrid-header-separators/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Although the default alo theme in Flex can be easily styled through CSS (made especially easy using the <a href="http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html">Flex Style Explorer</a>), there are elements such as separators between the column headers that cannot easily be styled. As the Halo skin for such elements are overridable, we can use the following solution to change their colour or remove them altogether.</p>
<p>By default Flex places two vertical, 1 pixel wide lines between each column header on a data grid (1 line white with a 50% transparency, the other the border colour). However in some instances this style does not look right, espeically if you are trying to create a dark charcol grey theme, the white vertical line stands out too much, or you don&#8217;t want any separators.</p>
<p>We could override this functionality by creating a 1&#215;1px transaparent .png and use that as the skin, but I am going to show you how we can create programmatic skin to get rid of a UI skin such as this, that we can then take a step further and customise into our own CSS stylable skin.</p>
<p><span id="more-82"></span><br />
So firstly to create a NullSkin class that we can use to rid ourselves of the separators alltogether. Programmatic skins can be created by extending either the ProgrammaticSkin, Border or RectBorder classes. In this case we are going to extend ProgrammicSkin, overriding it&#8217;s measuredWidth(), measuredHeight() and updateDisplayList(w:Number, h:Number) methods.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="actionscript">package com.<span style="color: #006600;">triggersoft</span>.<span style="color: #006600;">skins</span>
<span style="color: #66cc66;">&#123;</span>
  <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">skins</span>.<span style="color: #006600;">ProgrammaticSkin</span>;
  <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Graphics</span>; 
&nbsp;
  <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> NullSkin <span style="color: #0066CC;">extends</span> ProgrammaticSkin
  <span style="color: #66cc66;">&#123;</span>
    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> NullSkin<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
      <span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span> 
&nbsp;
    override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> measuredWidth<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span>;
    <span style="color: #66cc66;">&#125;</span> 
&nbsp;
    override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> measuredHeight<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span>;
    <span style="color: #66cc66;">&#125;</span> 
&nbsp;
    override protected  <span style="color: #000000; font-weight: bold;">function</span> updateDisplayList<span style="color: #66cc66;">&#40;</span>w:<span style="color: #0066CC;">Number</span>, h:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Above we return a skin size of 0 x 0px and in the updateDisplayList method (where we would draw the skin) we do nothing.</p>
<p>We can then easily apply this skin to the DataGrid in CSS using the following CSS declaration:</p>

<div class="wp_syntax"><div class="code"><pre class="css">header-separator-skin<span style="color: #66cc66;">:</span> ClassReference<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;com.triggersoft.skins.NullSkin&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>Removing the separator is all well and good but what if we want to create a more customisable skin? For example we could make a 1px wide vertical line that was the same colour as the data grid&#8217;s border colour as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript">package com.<span style="color: #006600;">triggersoft</span>.<span style="color: #006600;">skins</span>
<span style="color: #66cc66;">&#123;</span>
  <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">skins</span>.<span style="color: #006600;">ProgrammaticSkin</span>;
  <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Graphics</span>;
&nbsp;
  <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> DGHeaderColourSeparator <span style="color: #0066CC;">extends</span> ProgrammaticSkin
  <span style="color: #66cc66;">&#123;</span>
&nbsp;
    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> DGHeaderColourSeparator<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> measuredWidth<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">1</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> measuredHeight<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">10</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    override protected  <span style="color: #000000; font-weight: bold;">function</span> updateDisplayList<span style="color: #66cc66;">&#40;</span>w:<span style="color: #0066CC;">Number</span>, h:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">borderColor</span>:uint = <span style="color: #0066CC;">getStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;borderColor&quot;</span><span style="color: #66cc66;">&#41;</span>;
      <span style="color: #000000; font-weight: bold;">var</span> g:Graphics = graphics;
      g.<span style="color: #0066CC;">moveTo</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
      g.<span style="color: #0066CC;">lineStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>,<span style="color: #0066CC;">borderColor</span><span style="color: #66cc66;">&#41;</span>;
      g.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,h<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>The code above is based heavily on the original programmatic skin for the header separators in the Halo theme. Above we return a width of 1px and a height of 10px (Halo&#8217;s is 2 x 10px) we then move our drawing cursor to 0,0 (top left hand corner of skin), set the line style to be 1px wide and use the value set by borderColor in our CSS (or the default) and draw a line down to (0,h) which is the full height of the skin.</p>
<p>Again we need to set the skin in our application&#8217;s CSS file:</p>

<div class="wp_syntax"><div class="code"><pre class="css">header-separator-skin<span style="color: #66cc66;">:</span> ClassReference<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;com.triggersoft.skins.DGHeaderColourSeparator &quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>Now whatever colour the border is around our datagrid, our header separator will be the same colour. As you can see, programmatic skins give a little advantage over their .png cousins as we can use CSS styling to easily customise them and make them reusable across projects.</p>
<p>The best place to look and learn how Programmatic Skinning is done is to look at the source code for the Halo theme, this is located in [Flexbuilder installation]/Flex SDK 2/framework/source/mx/skins/halo/ but there are several great resources on skinning in general that I have listed below:</p>
<h2>More information on skinning and themes:</h2>
<ul>
<li><a href="http://www.adobe.com/devnet/flex/design.html">Flex Developer Center (UI Design)</a></li>
<li><a href="http://www.scalenine.com/">ScaleNine </a>(in particular the<a href="http://www.scalenine.com/resources.html"> resources page</a>)</li>
<li><a href="http://fleksray.org/Flex_skin.html">fle[ks]ray</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/miletbaker?a=vH2WepD"><img src="http://feeds.feedburner.com/~f/miletbaker?i=vH2WepD" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=8tmySNd"><img src="http://feeds.feedburner.com/~f/miletbaker?i=8tmySNd" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=gymkfqD"><img src="http://feeds.feedburner.com/~f/miletbaker?i=gymkfqD" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=YWRk0Sd"><img src="http://feeds.feedburner.com/~f/miletbaker?i=YWRk0Sd" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=CCh3swD"><img src="http://feeds.feedburner.com/~f/miletbaker?i=CCh3swD" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=sVmEXKd"><img src="http://feeds.feedburner.com/~f/miletbaker?i=sVmEXKd" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=YCEdL2D"><img src="http://feeds.feedburner.com/~f/miletbaker?i=YCEdL2D" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/miletbaker/~4/225204913" height="1" width="1"/>]]></content:encoded><description>Although the default alo theme in Flex can be easily styled through CSS (made especially easy using the Flex Style Explorer), there are elements such as separators between the column headers that cannot easily be styled. As the Halo skin for such elements are overridable, we can use the following solution to change their colour [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://clockobj.co.uk/2008/01/29/adobe-flex-styling-the-datagrid-header-separators/feed/</wfw:commentRss><feedburner:origLink>http://clockobj.co.uk/2008/01/29/adobe-flex-styling-the-datagrid-header-separators/</feedburner:origLink></item><item><title>Scaling up EasyMVC as your Flex application grows (Part 1)</title><link>http://feeds.feedburner.com/~r/miletbaker/~3/220329738/</link><category>Flex</category><category>ActionScript</category><category>as3</category><category>easymvc</category><category>RIAs</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jon</dc:creator><pubDate>Mon, 21 Jan 2008 05:52:39 -0600</pubDate><guid isPermaLink="false">http://clockobj.co.uk/2008/01/21/scaling-up-easymvc-as-your-flex-application-grows-part-1/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p><a href="http://clockobj.co.uk/2007/10/17/simplified-cairngorm-easy-mvc-for-adobe-flex/">EasyMVC</a> is an excellent, easy to use Model View Controller architecture for Adobe Flex designed by <a href="http://www.tombray.com">Tom Bray</a> from <a href="http://www.chatopica.com">Chatopica</a>. However as your apps grow you may find yourself outgrowing this architecture. For example as all your event handlers are centralised into one class, this class may get to large to maintain, especially as the team maintaining the app also expands.One of the best solutions I have found to handling a growing controller is to borrow the command pattern from <a href="http://labs.adobe.com/wiki/index.php/Cairngorm">Cairngorm </a>which uses the Command design pattern.</p>
<p>Note if you have not read my previous article on EasyMVC, <a href="http://clockobj.co.uk/2007/10/17/simplified-cairngorm-easy-mvc-for-adobe-flex/">click to read it here first</a>.</p>
<p>What Cairngorm does is to move these centralised event handlers from the controller into separate &#8220;command&#8221; classes. In a simple sense we are putting each of these event handlers into their own separate classes that contains just that event handler and and services the command uses. We could simply copy and paste the event handlers over as they are, initialise the class and pass the handler function (it will need to be public) within the class as the event handler. However, we want to make our lives a bit easier and this is where the command design pattern comes in.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</pre></td><td class="code"><pre class="actionscript">package com.<span style="color: #006600;">clockobj</span>.<span style="color: #006600;">gotidal</span>.<span style="color: #006600;">controller</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
&nbsp;
<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">core</span>.<span style="color: #006600;">UIComponent</span>;
&nbsp;
<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">events</span>.<span style="color: #006600;">FlexEvent</span>;
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> GoTidalController <span style="color: #0066CC;">extends</span> UIComponent <span style="color: #66cc66;">&#123;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> am:AppModel = AppModel.<span style="color: #006600;">getInstance</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> GoTidalController<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
      addEventListener<span style="color: #66cc66;">&#40;</span> FlexEvent.<span style="color: #006600;">CREATION_COMPLETE</span>, setupEventListeners <span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> setupEventListeners<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>
&nbsp;
      systemManager.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>AppEvent.<span style="color: #006600;">COUNTRYCHANGED</span>, countryChanged<span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// Country Changed</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> countryChanged<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:AppEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
      am.<span style="color: #006600;">setCountry</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
  <span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Above we have an example of an EasyMVC controller which extends the UIComponent and then adds our centralised event handlers to the system manager (which can see all application events through bubbling). In this example, we have a single event handler called countryChanged which stores the changed data (passed by the event) into the AppModel (Singleton model) but as our application grows we could end up with tens if not hundreds of commands.</p>
<p>Cairngorm&#8217;s strength is toe move these commands out into their own classes as discussed above. I like to create an interface definition for this class so that all commands are standard and then I can write a method to handle registering the class as an event listener on the systemManager class.</p>
<p>I use the following interface:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="actionscript">package com.<span style="color: #006600;">triggersoft</span>.<span style="color: #006600;">core</span>.<span style="color: #006600;">emvc</span><span style="color: #66cc66;">&#123;</span>  <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">interface</span> IEMVCCommand
&nbsp;
  <span style="color: #66cc66;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> execute<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>;
&nbsp;
  <span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Then any commands we create we need to implement this interface:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="actionscript">package com.<span style="color: #006600;">clockobj</span>.<span style="color: #006600;">gotidal</span>.<span style="color: #006600;">controller</span>.<span style="color: #006600;">commands</span><span style="color: #66cc66;">&#123;</span>  <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;  <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> CountryChangedCommand <span style="color: #0066CC;">implements</span> IEMVCCommand
&nbsp;
  <span style="color: #66cc66;">&#123;</span>
&nbsp;
    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> execute<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
&nbsp;
    <span style="color: #66cc66;">&#123;</span>
&nbsp;
      AppModel.<span style="color: #006600;">getInstance</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">setCountry</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
  <span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Then rather than having to keep initialising the new command and then adding the command as an event listener as follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="actionscript"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> setupEventListeners<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>
&nbsp;
  <span style="color: #000000; font-weight: bold;">var</span> countryChangedCmd:CountryChangedCommand = <span style="color: #000000; font-weight: bold;">new</span> CountryChangedCommand<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
  systemManager.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>AppEvent.<span style="color: #006600;">COUNTRYCHANGED</span>, countryChangedCmd.<span style="color: #006600;">execute</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>We can create a function to do this for us, making use of the interface definition we created:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="actionscript"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> addCommand<span style="color: #66cc66;">&#40;</span>eventType:<span style="color: #0066CC;">String</span>, cmd:IEMVCCommand<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
  systemManager.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>eventType, cmd.<span style="color: #006600;">execute</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>And in our event controller simplify it so that commands are added using our addCommand function</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="actionscript"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> setupEventListeners<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>
&nbsp;
  addCommand<span style="color: #66cc66;">&#40;</span>AppEvent.<span style="color: #006600;">COUNTRYCHANGED</span>, <span style="color: #000000; font-weight: bold;">new</span> countryChangedCmd<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>With this solution we borrow how Cairngorm handles events and have a scalable Controller where each handler is in it&#8217;s own command class and the controller is only used to register these commands as eventListeners on the systemManager class..</p>
<p>Taking this idea further, I like to create a EMVCController class which I then extend. i.e. the EMVCController has the addCommand method in it and it extends UIComponent and my Flex&#8217;s application controller has to simply extend EMVCController instead of UIComponent as was done previously and I inherit the addCommand method so don&#8217;t have to write it for each project.</p>
<p><a href="http://clockobj.co.uk/2008/03/04/scaling-up-easymvc-as-your-flex-application-grows-part-2-services/">In part 2 I will look at how we share web / http services between commands.</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/miletbaker?a=fyRXeTD"><img src="http://feeds.feedburner.com/~f/miletbaker?i=fyRXeTD" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=cPIQ8Rd"><img src="http://feeds.feedburner.com/~f/miletbaker?i=cPIQ8Rd" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=SPTwBED"><img src="http://feeds.feedburner.com/~f/miletbaker?i=SPTwBED" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=gLe8dNd"><img src="http://feeds.feedburner.com/~f/miletbaker?i=gLe8dNd" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=dvAlIyD"><img src="http://feeds.feedburner.com/~f/miletbaker?i=dvAlIyD" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=zY9l6Yd"><img src="http://feeds.feedburner.com/~f/miletbaker?i=zY9l6Yd" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=OAlBe9D"><img src="http://feeds.feedburner.com/~f/miletbaker?i=OAlBe9D" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/miletbaker/~4/220329738" height="1" width="1"/>]]></content:encoded><description>EasyMVC is an excellent, easy to use Model View Controller architecture for Adobe Flex designed by Tom Bray from Chatopica. However as your apps grow you may find yourself outgrowing this architecture. For example as all your event handlers are centralised into one class, this class may get to large to maintain, especially as the [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://clockobj.co.uk/2008/01/21/scaling-up-easymvc-as-your-flex-application-grows-part-1/feed/</wfw:commentRss><feedburner:origLink>http://clockobj.co.uk/2008/01/21/scaling-up-easymvc-as-your-flex-application-grows-part-1/</feedburner:origLink></item><item><title>I’m a full time employee with Trigger Software</title><link>http://feeds.feedburner.com/~r/miletbaker/~3/214687939/</link><category>Flex</category><category>jon</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jon</dc:creator><pubDate>Thu, 10 Jan 2008 18:06:41 -0600</pubDate><guid isPermaLink="false">http://clockobj.co.uk/2008/01/11/im-a-full-time-employee-with-trigger-software/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p><a href="http://www.triggersoft.com"><img src="http://www.triggersoft.com/images/triggersoft%20logo.png" hspace="5" width="50" height="50" align="right" /></a>I was interested reading <a href="http://dougmccune.com/blog/2007/12/15/im-a-full-time-employee-with-universal-mind/">Doug Mccune&#8217;s post last month</a> as I doing the same thing&#8230; Not joining the same company but I have recently made exactly the same move from freelance to full-time employee for <a href="http://www.triggersoft.com">Trigger Software</a> based in Cheltenham.</p>
<p>I am employed as the Adobe Flex Team Leader and much like Doug I am building a team of &#8220;rockstar developers&#8221;.</p>
<p>What this means for you? Well this blog will become more focussed on Adobe Flex. Sorry Ruby on Rails and .Net guys! (though there may be the odd .Net / Flex article) and if you are a Flex Developer looking to join a talented team of Flex Developers then drop me a line, we have some very exciting large scale international flex projects in the pipeline.</p>
<p>It also means I am no longer available for independent freelance work, but please direct all Adobe Flex development enquires to <a href="http://www.triggersoft.com/contact.htm">Trigger</a>
<p>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/miletbaker?a=6X9ebTD"><img src="http://feeds.feedburner.com/~f/miletbaker?i=6X9ebTD" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=hPCcZed"><img src="http://feeds.feedburner.com/~f/miletbaker?i=hPCcZed" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=x0csoiD"><img src="http://feeds.feedburner.com/~f/miletbaker?i=x0csoiD" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=TAbgtkd"><img src="http://feeds.feedburner.com/~f/miletbaker?i=TAbgtkd" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=A5ckrfD"><img src="http://feeds.feedburner.com/~f/miletbaker?i=A5ckrfD" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=KU1bbld"><img src="http://feeds.feedburner.com/~f/miletbaker?i=KU1bbld" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=uVPannD"><img src="http://feeds.feedburner.com/~f/miletbaker?i=uVPannD" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/miletbaker/~4/214687939" height="1" width="1"/>]]></content:encoded><description>I was interested reading Doug Mccune&amp;#8217;s post last month as I doing the same thing&amp;#8230; Not joining the same company but I have recently made exactly the same move from freelance to full-time employee for Trigger Software based in Cheltenham.
I am employed as the Adobe Flex Team Leader and much like Doug I am building a team of &amp;#8220;rockstar [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://clockobj.co.uk/2008/01/11/im-a-full-time-employee-with-trigger-software/feed/</wfw:commentRss><feedburner:origLink>http://clockobj.co.uk/2008/01/11/im-a-full-time-employee-with-trigger-software/</feedburner:origLink></item><item><title>Designing for Flex: Part 6 now online</title><link>http://feeds.feedburner.com/~r/miletbaker/~3/195510400/</link><category>Flex</category><category>Usability</category><category>Flex Usability</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jon</dc:creator><pubDate>Wed, 05 Dec 2007 07:16:18 -0600</pubDate><guid isPermaLink="false">http://clockobj.co.uk/2007/12/05/designing-for-flex-part-6-now-online/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Hot on the heals of Part5:  <a href="http://www.adobe.com/devnet/flex/articles/fig_pt5.html">Designing Content Displays</a>, <a href="http://usereccentric.com/">Rob Adams</a> has just posted up the <a href="http://www.adobe.com/devnet/flex/articles/fig_pt6.html">next chapter</a> of his excellent designing for flex articles, titled <a href="http://www.adobe.com/devnet/flex/articles/fig_pt6.html">Part 6:Guiding with motion</a> to the <a href="http://www.adobe.com/devnet/flex/?navID=fig">Adobe Flex Developer Center: Flex Interface Guide</a>. If you have not read the other five parts, <a href="http://www.adobe.com/devnet/flex/?navID=fig">check them out first</a>.</p>
<p>This chapter covers:</p>
<ul>
<li>The differences 		      between motion design in Flex applications and motion design in other mediums.</li>
<li>How to use motion 		      to leverage users&#8217; instinctual understanding of the 	        physical world to enhance your application&#8217;s usability.</li>
<li>How to use screen 		      to screen transitions to help guide users to the next area of interest and make 	        it clear how to return.</li>
<li>How to use motion 	          effects to provide feedback and focus your users&#8217; attention.</li>
</ul>
<h3>For More Information</h3>
<ul>
<li> <a href="http://www.adobe.com/devnet/flex/?navID=fig">Flex Interface Guide</a></li>
<li><a href="http://www.adobe.com/devnet/flex/">Flex Developer Center</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/miletbaker?a=DmR8nmC"><img src="http://feeds.feedburner.com/~f/miletbaker?i=DmR8nmC" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=GyxaMqc"><img src="http://feeds.feedburner.com/~f/miletbaker?i=GyxaMqc" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=jwukpZC"><img src="http://feeds.feedburner.com/~f/miletbaker?i=jwukpZC" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=tsA049c"><img src="http://feeds.feedburner.com/~f/miletbaker?i=tsA049c" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=Efr7sLC"><img src="http://feeds.feedburner.com/~f/miletbaker?i=Efr7sLC" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=wUUDYhc"><img src="http://feeds.feedburner.com/~f/miletbaker?i=wUUDYhc" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=q7XVQOC"><img src="http://feeds.feedburner.com/~f/miletbaker?i=q7XVQOC" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/miletbaker/~4/195510400" height="1" width="1"/>]]></content:encoded><description>Hot on the heals of Part5:  Designing Content Displays, Rob Adams has just posted up the next chapter of his excellent designing for flex articles, titled Part 6:Guiding with motion to the Adobe Flex Developer Center: Flex Interface Guide. If you have not read the other five parts, check them out first.
This chapter covers:

The [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://clockobj.co.uk/2007/12/05/designing-for-flex-part-6-now-online/feed/</wfw:commentRss><feedburner:origLink>http://clockobj.co.uk/2007/12/05/designing-for-flex-part-6-now-online/</feedburner:origLink></item><item><title>Blog Updates</title><link>http://feeds.feedburner.com/~r/miletbaker/~3/194638015/</link><category>Misc..</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jon</dc:creator><pubDate>Mon, 03 Dec 2007 17:33:56 -0600</pubDate><guid isPermaLink="false">http://clockobj.co.uk/2007/12/03/blog-updates/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>I am making a few changes to the layout and style of the site. I apologise in advance for any disruption caused.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/miletbaker?a=PzzkqxC"><img src="http://feeds.feedburner.com/~f/miletbaker?i=PzzkqxC" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=Ro8pFBc"><img src="http://feeds.feedburner.com/~f/miletbaker?i=Ro8pFBc" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=3GxAG2C"><img src="http://feeds.feedburner.com/~f/miletbaker?i=3GxAG2C" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=RXahe7c"><img src="http://feeds.feedburner.com/~f/miletbaker?i=RXahe7c" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=jjKV1EC"><img src="http://feeds.feedburner.com/~f/miletbaker?i=jjKV1EC" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=mVjt7Zc"><img src="http://feeds.feedburner.com/~f/miletbaker?i=mVjt7Zc" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=9xJ6TxC"><img src="http://feeds.feedburner.com/~f/miletbaker?i=9xJ6TxC" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/miletbaker/~4/194638015" height="1" width="1"/>]]></content:encoded><description>I am making a few changes to the layout and style of the site. I apologise in advance for any disruption caused.</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://clockobj.co.uk/2007/12/03/blog-updates/feed/</wfw:commentRss><feedburner:origLink>http://clockobj.co.uk/2007/12/03/blog-updates/</feedburner:origLink></item><item><title>Released: WP-Flickr WordPress Plugin</title><link>http://feeds.feedburner.com/~r/miletbaker/~3/192529358/</link><category>Misc..</category><category>php</category><category>plugin</category><category>portfolio</category><category>wordpress</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jon</dc:creator><pubDate>Thu, 29 Nov 2007 13:13:30 -0600</pubDate><guid isPermaLink="false">http://clockobj.co.uk/2007/11/29/released-wp-flickr-wordpress-plugin/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>WP-Flickr is a WordPress plugin that allows you to add photos from Flickr to your posts, without leaving the WordPress write post / page editor. Browse your Flickr photostream, sets or favorites and select to insert into the page.</p>
<p class="contentbar_header">&nbsp;</p>
<p class="contentbar_body"><img src="http://farm3.static.flickr.com/2320/2073540263_640df95340.jpg" alt="Screenshot of WP-Flickr plugin" /></p>
<p class="contentbar_footer">Screenshot: WP-Flickr Plugin</p>
<p><span id="more-65"></span></p>
<p>As part of a recent project, we needed to develop a custom WordPress plugin for our client. They have kindly allowed us to release it under the GNU licence, so if you feel it is useful, please feel free to<a href="http://clockobj.co.uk/extras/wp-flickr/"> download and install it</a>. It is loosely based on the similar <a href="http://wordpress.org/extend/plugins/flickr-tag/">Flickr Tag WordPress plugin by Jeffery Maki</a> however rather than parsing the page each time a post is viewed and generating the image tag, this version inserts the image tag directly into the post. In addition you can  browse your Flickr Photostream, Sets and Favorites right from within the WordPress Admin pages, choosing the sizes available on flickr and inserting with a single click.</p>
<p>Feel free to <a href="http://clockobj.co.uk/extras/wp-flickr/">download and try the plugin</a>. It is currently hosted here but once approved for the WordPress Plugin Directory, it will be moved there.</p>
<h3>For more information:</h3>
<ul>
<li><a href="http://clockobj.co.uk/extras/wp-flickr/">Instructions and Download for WP-Flickr</a></li>
<li><a href="http://clockobj.co.uk/designdev/blogs-content-management-system/">Clockwork Objects&#8217; Blog and Content Management System Services</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/miletbaker?a=I59RbQB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=I59RbQB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=zBmEfTb"><img src="http://feeds.feedburner.com/~f/miletbaker?i=zBmEfTb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=KZWIDBB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=KZWIDBB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=nDhKj1b"><img src="http://feeds.feedburner.com/~f/miletbaker?i=nDhKj1b" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=9MoRBsB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=9MoRBsB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=rGFZJxb"><img src="http://feeds.feedburner.com/~f/miletbaker?i=rGFZJxb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=WA51wiB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=WA51wiB" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/miletbaker/~4/192529358" height="1" width="1"/>]]></content:encoded><description>WP-Flickr is a WordPress plugin that allows you to add photos from Flickr to your posts, without leaving the WordPress write post / page editor. Browse your Flickr photostream, sets or favorites and select to insert into the page.
&amp;#160;

Screenshot: WP-Flickr Plugin

As part of a recent project, we needed to develop a custom WordPress plugin for [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://clockobj.co.uk/2007/11/29/released-wp-flickr-wordpress-plugin/feed/</wfw:commentRss><feedburner:origLink>http://clockobj.co.uk/2007/11/29/released-wp-flickr-wordpress-plugin/</feedburner:origLink></item><item><title>Conducting DIY User Reseach</title><link>http://feeds.feedburner.com/~r/miletbaker/~3/190860977/</link><category>Usability</category><category>DIY</category><category>User Research</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jon</dc:creator><pubDate>Mon, 26 Nov 2007 13:19:47 -0600</pubDate><guid isPermaLink="false">http://clockobj.co.uk/2007/11/26/conducting-diy-user-reseach/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p><a href="http://www.disambiguity.com">Leisa Reichelt</a> has posted up an <a href="http://www.disambiguity.com/diy-user-research-my-barcamp-presentation/">interesting presentation on DIY guerrilla User Research</a> which is well worth a look. I have embedded her slideshow below.</p>
<p>She points out that no matter how small the budget, even a small amount of User Research can pay off in a big way. She goes through some of the techniques used by Interaction Designers when conducting research and some invaluable tips on conducting and writing interviews, it is well worth a look:</p>
<p><a href="http://www.slideshare.net/leisa/diy-user-research-londonbarcamp3" title="View 'DIY User Research (LondonBarCamp3)' on SlideShare">View Leisa&#8217;s Presentation on slide share.</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/miletbaker?a=kjuQ1kB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=kjuQ1kB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=IeGDJUb"><img src="http://feeds.feedburner.com/~f/miletbaker?i=IeGDJUb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=sgnUfNB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=sgnUfNB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=HHrtZzb"><img src="http://feeds.feedburner.com/~f/miletbaker?i=HHrtZzb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=PYtjAQB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=PYtjAQB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=7AU1fxb"><img src="http://feeds.feedburner.com/~f/miletbaker?i=7AU1fxb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=mOrgW5B"><img src="http://feeds.feedburner.com/~f/miletbaker?i=mOrgW5B" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/miletbaker/~4/190860977" height="1" width="1"/>]]></content:encoded><description>Leisa Reichelt has posted up an interesting presentation on DIY guerrilla User Research which is well worth a look. I have embedded her slideshow below.
She points out that no matter how small the budget, even a small amount of User Research can pay off in a big way. She goes through some of the techniques [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://clockobj.co.uk/2007/11/26/conducting-diy-user-reseach/feed/</wfw:commentRss><feedburner:origLink>http://clockobj.co.uk/2007/11/26/conducting-diy-user-reseach/</feedburner:origLink></item><item><title>Using a plain Flex UI theme to show clients before styling</title><link>http://feeds.feedburner.com/~r/miletbaker/~3/185367773/</link><category>Flex</category><category>Usability</category><category>prototyping</category><category>wireframe</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jon</dc:creator><pubDate>Thu, 15 Nov 2007 13:18:24 -0600</pubDate><guid isPermaLink="false">http://clockobj.co.uk/2007/11/15/using-a-plain-flex-ui-theme-to-show-clients-before-styling/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>The default Flex 2 Aeon theme looks fairly polished and showing it to clients in the early stages of a project can have it&#8217;s disadvantages. For example a client may believe the project is closer to release than it is or if you use Adobe Flex for prototyping may believe that the default theme represents the final look and feel.</p>
<p>If you intend to customise the chrome of a flex app, showing a client the default look and feel not only leads the client into a false expectation of the finish product but, if the app is purely a prototype, may make a case for it being used for the foundation of production code or prevent an further exploration in to the visual design.</p>
<p><a href="http://www.onflex.org/">Ted Patrick </a>has provided an excellent technique to overcome this.<br />
<span id="more-55"></span><br />
Using <a href="http://www.onflex.org/ted/2007/11/managing-ui-development-expectations.php">Ted&#8217;s example</a> you can strip all chrome from the UI components and then effectively build an interactive wireframe for your app which can then be styled / disgarded without any preconceptions on the client&#8217;s behalf.</p>
<p class="contentbar_header">&nbsp;</p>
<p class="contentbar_body"><img src="http://onflex.org/images/plainskin.png" height="568" width="491" /></p>
<p class="contentbar_footer">Ted Patrick&#8217;s Chromeless Flex Theme</p>
<p>Ted provides the sources for his example which also includes the CSS to strip the Halo theme&#8217;s chrome from the UI controls.</p>
<h3>For more information:</h3>
<ul>
<li><a href="http://www.onflex.org/ted/2007/11/managing-ui-development-expectations.php">Ted&#8217;s Article on Managing UI Development Expectations with Flex</a></li>
<li><a href="http://www.onflex.org/">Ted on Flex Blog </a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/miletbaker?a=TrLRAMB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=TrLRAMB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=cJjuC6b"><img src="http://feeds.feedburner.com/~f/miletbaker?i=cJjuC6b" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=CPdrppB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=CPdrppB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=MEKKmMb"><img src="http://feeds.feedburner.com/~f/miletbaker?i=MEKKmMb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=tGebidB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=tGebidB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=pgwThQb"><img src="http://feeds.feedburner.com/~f/miletbaker?i=pgwThQb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=8koJo8B"><img src="http://feeds.feedburner.com/~f/miletbaker?i=8koJo8B" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/miletbaker/~4/185367773" height="1" width="1"/>]]></content:encoded><description>The default Flex 2 Aeon theme looks fairly polished and showing it to clients in the early stages of a project can have it&amp;#8217;s disadvantages. For example a client may believe the project is closer to release than it is or if you use Adobe Flex for prototyping may believe that the default theme represents [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://clockobj.co.uk/2007/11/15/using-a-plain-flex-ui-theme-to-show-clients-before-styling/feed/</wfw:commentRss><feedburner:origLink>http://clockobj.co.uk/2007/11/15/using-a-plain-flex-ui-theme-to-show-clients-before-styling/</feedburner:origLink></item><item><title>Designing for Flex: Part 5 now online</title><link>http://feeds.feedburner.com/~r/miletbaker/~3/184666021/</link><category>Flex</category><category>Usability</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jon</dc:creator><pubDate>Wed, 14 Nov 2007 07:41:14 -0600</pubDate><guid isPermaLink="false">http://clockobj.co.uk/2007/11/14/designing-for-flex-part-5-now-online/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Hi All,</p>
<p>Just a quick post. <a href="http://usereccentric.com/">Rob Adams</a> has just posted up the <a href="http://www.adobe.com/devnet/flex/articles/fig_pt5.html">next installment</a> of his excellent designing for flex articles, titled Part 5: <a href="http://www.adobe.com/devnet/flex/articles/fig_pt5.html">Designing Content Displays</a> to the <a href="http://www.adobe.com/devnet/flex/?navID=fig">Adobe Flex Developer Center: Flex Interface Guide</a>. If you have not read the other four parts, <a href="http://www.adobe.com/devnet/flex/?navID=fig">check them out first</a>.</p>
<p>For More Information</p>
<ul>
<li><a href="http://www.adobe.com/devnet/flex/?navID=fig">Flex Interface Guide</a></li>
<li><a href="http://www.adobe.com/devnet/flex/">Flex Developer Center</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/miletbaker?a=EvSBlOB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=EvSBlOB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=ufsCUqb"><img src="http://feeds.feedburner.com/~f/miletbaker?i=ufsCUqb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=EZCyhZB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=EZCyhZB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=6P1K2fb"><img src="http://feeds.feedburner.com/~f/miletbaker?i=6P1K2fb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=tbSK6CB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=tbSK6CB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=lkCTkjb"><img src="http://feeds.feedburner.com/~f/miletbaker?i=lkCTkjb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=nkKjchB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=nkKjchB" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/miletbaker/~4/184666021" height="1" width="1"/>]]></content:encoded><description>Hi All,
Just a quick post. Rob Adams has just posted up the next installment of his excellent designing for flex articles, titled Part 5: Designing Content Displays to the Adobe Flex Developer Center: Flex Interface Guide. If you have not read the other four parts, check them out first.
For More Information

Flex Interface Guide
Flex Developer Center</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://clockobj.co.uk/2007/11/14/designing-for-flex-part-5-now-online/feed/</wfw:commentRss><feedburner:origLink>http://clockobj.co.uk/2007/11/14/designing-for-flex-part-5-now-online/</feedburner:origLink></item><item><title>FIG: User Experience Design resource for Adobe Flex</title><link>http://feeds.feedburner.com/~r/miletbaker/~3/180003882/</link><category>Flex</category><category>Usability</category><category>Interaction Design</category><category>User Centered Design</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jon</dc:creator><pubDate>Mon, 05 Nov 2007 05:49:29 -0600</pubDate><guid isPermaLink="false">http://clockobj.co.uk/2007/11/05/fig-user-experience-design-resource-for-adobe-flex/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Back in September, Adobe released a <a href="http://www.adobe.com/devnet/flex/?navID=fig">new section to the Flex Developer Center, called FIG or Flex Interface Guide</a>. This is an excellent resource for anyone involved in the Interaction Design (IxD) or User Experience (Ux) of RIAs or any developers who want to make more user focussed apps. There are several articles still in draft about designing for Flex. One of the upcoming articles that will be particularly of interest and relevance to the new possibilities of designing RIAs is the use of motion, as a tool to guide users.</p>
<p><span id="more-44"></span><br />
The articles are written  by Adobe&#8217;s <a href="http://usereccentric.com/">Rob Adams</a> who also writes a blog dedicated to interaction design (<a href="http://usereccentric.com/">http://usereccentric.com/</a>)</p>
<p>In addition to these articles Rob and the team will be releasing a set of Flex Interface guideleines and introducing new components to use in Flex development such as the three already released: <a href="http://www.adobe.com/devnet/flex/samples/fig_callout/">Callouts</a>, <a href="http://www.adobe.com/devnet/flex/samples/fig_pagedlist/">Paged Lists</a> &amp; <a href="http://www.adobe.com/devnet/flex/samples/fig_panzoom/">Pan and Zoom</a>. (I will be covering these in more detail in future posts.)</p>
<p class="contentbar_header">&nbsp;</p>
<p class="contentbar_body"><img src="http://farm3.static.flickr.com/2388/1870931639_53b57cc4ca.jpg" height="274" width="500" /></p>
<p class="contentbar_footer">Adobe FIG&#8217;s Callout Component.</p>
<p>So far Rob has written 4 of the 8 intended articles and the first 4 are an excellent and I recommended taking the time to read them. They provide a good overview of the technology for IxD professionals covering some of the new possibilities like using motion to guide user interaction. For developers these resources will hopefully introduce the benefits of thinking about users and give plenty to think about as well as introduce interaction design methods to improving user experience.</p>
<p>Rob also provides a well selected list of further reading in which he highlights <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2FAbout-Face-2-0-Essentials-Interaction%2Fdp%2F0764526413%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1194262926%26sr%3D8-1&amp;tag=clockobjec-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">Alan Cooper&#8217;s About Face 2</a><img src="http://www.assoc-amazon.com/e/ir?t=clockobjec-20&amp;l=ur2&amp;o=1" style="border: medium none  ! important; margin: 0px ! important" border="0" height="1" width="1" />, at the top of the list (<a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2FAbout-Face-Essentials-Interaction-Design%2Fdp%2F0470084111%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1194263082%26sr%3D1-1&amp;tag=clockobjec-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">About Face 3</a><img src="http://www.assoc-amazon.com/e/ir?t=clockobjec-20&amp;l=ur2&amp;o=1" style="border: medium none  ! important; margin: 0px ! important" border="0" height="1" width="1" /> has recently been released). Which shows he is an advocate of Goal Driven Design when designing Flex apps. However he does note that it is not necessary to be following an upfront process such as Goal-Driven Design to benefit from his articles and his advise is suitable to any development process.</p>
<p>As the documents are in draft Rob has set up a <a href="http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid=60&amp;catid=660&amp;entercat=y">forum on the Adobe site</a> for input and feedback from the community. So far been a disappointing response with only 12 posts (and I believe I have posted two of those!) So please get involved and please give Rob feedback on his excellent work and commitment to providing better user experiences for users of Flex apps.</p>
<h3>For more information</h3>
<ul>
<li><a href="http://www.adobe.com/devnet/flex/?navID=fig">Flex Interface Guide</a></li>
<li><a href="http://www.usereccentric.com/">Rob Adams&#8217; User Eccentric Blog</a></li>
<li><a href="http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid=60&amp;catid=660&amp;entercat=y">Flex Interface Guide Forum</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/miletbaker?a=hedO3QB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=hedO3QB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=w8Z2ZCb"><img src="http://feeds.feedburner.com/~f/miletbaker?i=w8Z2ZCb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=dimlzJB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=dimlzJB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=zR7PCYb"><img src="http://feeds.feedburner.com/~f/miletbaker?i=zR7PCYb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=tJ8crbB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=tJ8crbB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=Ol6EQ4b"><img src="http://feeds.feedburner.com/~f/miletbaker?i=Ol6EQ4b" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=mQgID1B"><img src="http://feeds.feedburner.com/~f/miletbaker?i=mQgID1B" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/miletbaker/~4/180003882" height="1" width="1"/>]]></content:encoded><description>Back in September, Adobe released a new section to the Flex Developer Center, called FIG or Flex Interface Guide. This is an excellent resource for anyone involved in the Interaction Design (IxD) or User Experience (Ux) of RIAs or any developers who want to make more user focussed apps. There are several articles still in [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://clockobj.co.uk/2007/11/05/fig-user-experience-design-resource-for-adobe-flex/feed/</wfw:commentRss><feedburner:origLink>http://clockobj.co.uk/2007/11/05/fig-user-experience-design-resource-for-adobe-flex/</feedburner:origLink></item><item><title>Moved to WordPress - Second migration in two months…</title><link>http://feeds.feedburner.com/~r/miletbaker/~3/178951538/</link><category>Misc..</category><category>jon</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jon</dc:creator><pubDate>Fri, 02 Nov 2007 11:27:41 -0500</pubDate><guid isPermaLink="false">http://test.clockobj.co.uk/2007/11/02/moved-to-wordpress-second-migration-in-two-months/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>I have migrated my blog from <a href="http://mephistoblog.com/">Mephisto</a> to <a href="http://mephistoblog.com/">Wordpress</a>. Before I get flamed for this, please let me apologise for any broken links. Any articles written in Mephisto (after August 2007) should be fine as I have set WordPress up to use the same style Permalinks, however any written in my .Net blog engine previous to that will now get my error page. I have tried to make this page as helpful as possible by providing a search facility.</p>
<p>My reasoning in moving to WordPress is not a reflection on Mephisto as it is an excellent blogging platform, however more to do with ease of deployment and hosting a PHP based system over a Ruby  on Railsbased system.</p>
<p>Once again I apologise if you are unable to find the article you are looking for, you should be able to locate it through the search facility or using the Categories or tags (on the left).</p>
<p>Regards,</p>
<p>Jon</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/miletbaker?a=tOBNuAB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=tOBNuAB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=aHYtqRb"><img src="http://feeds.feedburner.com/~f/miletbaker?i=aHYtqRb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=3EAdNtB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=3EAdNtB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=VwxSErb"><img src="http://feeds.feedburner.com/~f/miletbaker?i=VwxSErb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=8LJK7RB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=8LJK7RB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=BXA2Oib"><img src="http://feeds.feedburner.com/~f/miletbaker?i=BXA2Oib" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=RX3uxyB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=RX3uxyB" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/miletbaker/~4/178951538" height="1" width="1"/>]]></content:encoded><description>I have migrated my blog from Mephisto to Wordpress. Before I get flamed for this, please let me apologise for any broken links. Any articles written in Mephisto (after August 2007) should be fine as I have set WordPress up to use the same style Permalinks, however any written in my .Net blog engine previous [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://clockobj.co.uk/2007/11/02/moved-to-wordpress-second-migration-in-two-months/feed/</wfw:commentRss><feedburner:origLink>http://clockobj.co.uk/2007/11/02/moved-to-wordpress-second-migration-in-two-months/</feedburner:origLink></item><item><title>Adobe Flex Builder 2: Free to education</title><link>http://feeds.feedburner.com/~r/miletbaker/~3/178951539/</link><category>Flex</category><category>ActionScript</category><category>RIAs</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jon</dc:creator><pubDate>Wed, 24 Oct 2007 17:01:06 -0500</pubDate><guid isPermaLink="false">http://old.miletbaker.com/index.php/2007/10/24/adobe-flex-builder-2-free-to-education/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Adobe have today announced that they will be offering Flex builder 2 as a free download (at no cost) to education establishments and students. Not only a welcomed announcement by the community but also this shrewd move will mean more institutions teaching Rich Internet Application development, and more graduates ready to tackle the next generation of web applications and satisfy the growing demand for Flex developers. (Hopefully in time for the impending Rich Internet Application boom?)</p>
<h3>For More Information.</h3>
<ul>
<li><a href="http://blogs.adobe.com/educationleaders/2007/10/adobe_advances_web_20_in_educa.html">Adobe&#8217;s Announcement</a></li>
</ul>
<p><img src="http://feeds.feedburner.com/~r/miletbaker/~4/174534519" height="1" width="1" /></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/miletbaker?a=odZmaVB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=odZmaVB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=iHzZU3b"><img src="http://feeds.feedburner.com/~f/miletbaker?i=iHzZU3b" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=k9RqHzB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=k9RqHzB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=n2muoCb"><img src="http://feeds.feedburner.com/~f/miletbaker?i=n2muoCb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=vV71XnB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=vV71XnB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=RNJuLhb"><img src="http://feeds.feedburner.com/~f/miletbaker?i=RNJuLhb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=kiHIANB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=kiHIANB" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/miletbaker/~4/178951539" height="1" width="1"/>]]></content:encoded><description>Adobe have today announced that they will be offering Flex builder 2 as a free download (at no cost) to education establishments and students. Not only a welcomed announcement by the community but also this shrewd move will mean more institutions teaching Rich Internet Application development, and more graduates ready to tackle the next generation [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://clockobj.co.uk/2007/10/24/adobe-flex-builder-2-free-to-education/feed/</wfw:commentRss><feedburner:origLink>http://clockobj.co.uk/2007/10/24/adobe-flex-builder-2-free-to-education/</feedburner:origLink></item><item><title>TileUI Flex simulated desktop.</title><link>http://feeds.feedburner.com/~r/miletbaker/~3/178951540/</link><category>Flex</category><category>ActionScript</category><category>RIAs</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jon</dc:creator><pubDate>Tue, 23 Oct 2007 17:04:39 -0500</pubDate><guid isPermaLink="false">http://old.miletbaker.com/index.php/2007/10/23/tileui-flex-simulated-desktop/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>I was pleased to hear the announcement that <a href="http://dougmccune.com/blog/">Doug McCune</a> will be writing the upcoming Flex 3 for Dummies with <a href="http://iamdeepa.com/blog/">Deepa Subramaniam</a>. I am looking forward to seeing this early next year. What I am most excited about however, is that <a href="http://dougmccune.com/blog/2007/10/23/writing-flex-for-dummies/">Doug has posted a sneak peek of his excellent TileUI Flex App</a> to promote his announcement.</p>
<p class="contentbar_header">&nbsp;</p>
<p class="contentbar_body"> <a href="http://dougmccune.com/blog/2007/10/23/writing-flex-for-dummies/"><img src="http://farm3.static.flickr.com/2072/1716645656_c9059b55d4_o.png" /></a></p>
<p class="contentbar_footer">Doug McCune&#8217;s TileUI.</p>
<p><span id="more-5"></span>Doug was interviewed about this on the <a href="http://flex.org/community/">Flex.org Podcast</a> In which I believe he stated that he made use of Papervision3D combined with <span class="caps">APE</span>.</p>
<p>You can easily group items, by holding down the left-mouse button and dragging around the items you want to group. By default these stack but when you hold the mouse button down to group a blue circle appears, if you return here and hover with the mouse button still down, you get the menu shown above, where you can then spiral the stack, or arrange them in a messy formation.</p>
<p>Once items are stacked, you can double click them for further options, but I&#8217;ll let you play and discover these yourselves.</p>
<p>I believe Doug based this on an another application, details of which are in the interview in the <a href="http://flex.org/community/">Flex.org Podcast</a></p>
<p>Thanks for the demo Doug.</p>
<p>Jon</p>
<h3>For more Information</h3>
<ul>
<li><a href="http://dougmccune.com/blog/2007/10/23/writing-flex-for-dummies/">Try out the demo on Doug&#8217;s Blog</a></li>
</ul>
<p><img src="http://feeds.feedburner.com/~r/miletbaker/~4/174005812" height="1" width="1" /></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/miletbaker?a=thxTpmB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=thxTpmB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=s42ewjb"><img src="http://feeds.feedburner.com/~f/miletbaker?i=s42ewjb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=a20ccIB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=a20ccIB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=fmXqj0b"><img src="http://feeds.feedburner.com/~f/miletbaker?i=fmXqj0b" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=Cs0OAoB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=Cs0OAoB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=d5Gcm6b"><img src="http://feeds.feedburner.com/~f/miletbaker?i=d5Gcm6b" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=0qbpBEB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=0qbpBEB" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/miletbaker/~4/178951540" height="1" width="1"/>]]></content:encoded><description>I was pleased to hear the announcement that Doug McCune will be writing the upcoming Flex 3 for Dummies with Deepa Subramaniam. I am looking forward to seeing this early next year. What I am most excited about however, is that Doug has posted a sneak peek of his excellent TileUI Flex App to promote [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://clockobj.co.uk/2007/10/23/tileui-flex-simulated-desktop/feed/</wfw:commentRss><feedburner:origLink>http://clockobj.co.uk/2007/10/23/tileui-flex-simulated-desktop/</feedburner:origLink></item><item><title>Review: Chat Widget for your Blog, Powered by Adobe Flex</title><link>http://feeds.feedburner.com/~r/miletbaker/~3/178951541/</link><category>Flex</category><category>RIAs</category><category>Ruby on Rails</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jon</dc:creator><pubDate>Fri, 19 Oct 2007 06:21:41 -0500</pubDate><guid isPermaLink="false">http://old.miletbaker.com/index.php/2007/10/19/review-chat-widget-for-your-blog-powered-by-adobe-flex/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Following my <a href="http://www.clockobj.co.uk/2007/10/17/simplified-cairngorm-easy-mvc-for-adobe-flex">previous article</a> I discovered <a href="http://www.chatopica.com/">Chatopica</a> an excellent chat widget, you can integrate directly into your blog. Current topics are related to programming and design but custom topics are coming soon.</p>
<p><a href="http://www.chatopica.com/">Chatopica</a> is created by <a href="http://www.tombray.com/">Tom Bray</a> and <a href="http://www.machine501.com/">Robert Cadena</a> of <a href="http://www.searchcoders.com/">SearchCoders</a>, Tom being the presenter of the excellent eSeminar on an <a href="http://www.clockobj.co.uk/2007/10/17/simplified-cairngorm-easy-mvc-for-adobe-flex">Easy <span class="caps"><span class="caps">MVC</span></span> approach to developing flex apps, I blogged about</a>.</p>
<div class="contentbar_header">&nbsp;</div>
<div class="contentbar_body" align="center">
<script src="http://www.chatopica.com/embed.js?room=flex&#038;width=500&#038;height=650&#038;bgcolor=222222"></script><br/>
</div>
<div class="contentbar_footer">&nbsp;</div>
<p><span id="more-6"></span></p>
<h2>What you can currently chat about in Chatopica</h2>
<p>Currently Chatopica offers the following topics, but the guys are working on the ability to create custom topics and you can register to be notified when this feature is added <a href="http://www.chatopica.com/">on their homepage</a> :</p>
<ol>
<li>Adobe Flash (Flash Programming and Design)</li>
<li>Adobe Flex (Flex Programming)</li>
<li>Adobe Photoshop</li>
<li><span class="caps"><span class="caps">AJAX</span></span> (AJAX Programming)</li>
<li>Book Club (Discussions on Books and Novels)</li>
<li>Chatopica (Chatopica)</li>
<li>ColdFusion (ColdFusion Programming)</li>
<li>Java (Java Programming)</li>
<li><span class="caps"><span class="caps">PHP</span></span> (PHP Programming and Web Development)</li>
<li>Python (Pythonistas Unite!)</li>
<li>Ruby On Rails</li>
<li>Video Games</li>
</ol>
<p>I like the widget so much that I have added two topics to my own blog, so if you would like to chat with like minded developers about Ruby on Rails or Adobe Flex you can access these here anytime:</p>
<ul>
<li><a href="http://www.clockobj.co.uk/flexchat">http://www.clockobj.co.uk/flexchat</a> (For Adobe Flex Chat)</li>
<li><a href="http://www.clockobj.co.uk/railschat">http://www.clockobj.co.uk/railschat</a> (For Ruby on Rails CHat)</li>
</ul>
<p><em><strong>Note</strong></em> There are not many Rails developers on here yet, but if you are in the Rails community, please spead the word.</p>
<p>Or even better, why not add this widget to your own Flex or Rails blog / website!</p>
<h2>Adding a Chatopica topic to your own site..</h2>
<p>Adding Chatopica to your own site is a piece of cake, simply visit the <a href="http://www.chatopica.com/topics/">Chatopica Topics section</a>, choose the topic(s) you would like on your site and copy and paste the one line of Javascript into the <span class="caps"><span class="caps">HTML</span></span> of your page. For those that have added other widgets to your sites, you will be familiar with this. It’s that easy. (That’s why I pasted one into this article.)</p>
<h2>Overview of Features</h2>
<p>When Chatopica first loads, it automatically assigns you a guest ID. You can change this at any time by clicking on the assigned guest ID in the top bar and entering a new nicname / display name. If you enter a name currently in use, the system smartly handles duplicate by appending a unique ID to the duplicate name you entered. If you don’t like this you can simply change it to something else.</p>
<p>Another nice feature for developers is that you can click the code button and copy and paste in, some source code. Not only does chatopica colorize your code, it also folds it so those who are not interested in seeing the code can ignore it without it filling their chat screen, while those that are interested can click the {} icon to expand the source code.</p>
<p>Chatopica, like many chat clients automatically scrolls to the latests message posted. A nice feature to Chatopica is the ability to turn the Autoscroll feature off by clicking the padlick icon in the bottom right of the widget. This then prevents the chat window from scrolling to the bottom when someone posts a new message, which is handy while examining someones source code.</p>
<p>With the ability to create your own custom chat room coming soon, we will all be able to add a little peice of Chatopica to our websites and blogs.</p>
<h3>For more information</h3>
<ul>
<li><a href="http://www.chatopica.com/">Chatopica</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/miletbaker?a=RpB1nLB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=RpB1nLB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=ZKZJFHb"><img src="http://feeds.feedburner.com/~f/miletbaker?i=ZKZJFHb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=ALrf6TB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=ALrf6TB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=eeZuXPb"><img src="http://feeds.feedburner.com/~f/miletbaker?i=eeZuXPb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=WZj7wnB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=WZj7wnB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=UMAyC5b"><img src="http://feeds.feedburner.com/~f/miletbaker?i=UMAyC5b" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/miletbaker?a=jt8h5gB"><img src="http://feeds.feedburner.com/~f/miletbaker?i=jt8h5gB" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/miletbaker/~4/178951541" height="1" width="1"/>]]></content:encoded><description>Following my previous article I discovered Chatopica an excellent chat widget, you can integrate directly into your blog. Current topics are related to programming and design but custom topics are coming soon.
Chatopica is created by Tom Bray and Robert Cadena of SearchCoders, Tom being the presenter of the excellent eSeminar on an Easy MVC approach [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://clockobj.co.uk/2007/10/19/review-chat-widget-for-your-blog-powered-by-adobe-flex/feed/</wfw:commentRss><feedburner:origLink>http://clockobj.co.uk/2007/10/19/review-chat-widget-for-your-blog-powered-by-adobe-flex/</feedburner:origLink></item><item><title>Simplified Cairngorm, Easy MVC for Adobe Flex</title><link>http://feeds.feedburner.com/~r/miletbaker/~3/178951542/</link><category>Flex</category><category>ActionScript</category><category>as3</category><category>easymvc</category><category>RIAs</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jon</dc:creator><pubDate>Wed, 17 Oct 2007 17:30:46 -0500</pubDate><guid isPermaLink="false">http://old.miletbaker.com/index.php/2007/10/17/simplified-cairngorm-easy-mvc-for-adobe-flex/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Like many others, I have been struggling to fully get my head fully around the <a href="http://labs.adobe.com/wiki/index.php/Cairngorm">Cairngorm Micro Architecture</a>, and even with the excellent <a href="http://www.tylerbeck.com/CairngormCreator/">Cairngorm Creator</a>, I find it a little overkill for many Adobe Flex projects I am involved with, in fact, <a href="http://weblogs.macromedia.com/swebster/archives/2006/08/why_i_think_you.cfm">so does Steven Webster</a> (one of the creators of Cairngorm).</p>
<p>So yesterday I sat in on an excellent Adobe eSeminar, presented by <a href="http://www.searchcoders.com/">Tom Bray of SearcherCoders</a> who presented an easy / simplified Model View Controller architecture based on Cairngorm.</p>
<p>To demonstrate the need for these frameworks, Tom started with an excellent example of an application based on a simple chat client. Inspired by his excellent <a href="http://www.chatopica.com/">Chatopica</a> perhaps?:<br />
<span id="more-7"></span></p>
<ol class="CodeRay">
<li><span class="pp">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;</span></li>
<li><span class="ta">&lt;mx:Application</span> <span class="an">xmlns:mx</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">http://www.adobe.com/2006/mxml</span><span class="dl">&#8220;</span></span> <span class="an">layout</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">vertical</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span></li>
<li> <span class="ta">&lt;mx:Script&gt;</span></li>
<li> <span class="er">&lt;</span>![CDATA[</li>
<li> import mx.collections.ArrayCollection;</li>
<li> [Bindable]</li>
<li> public var rooms:ArrayCollection = new ArrayCollection( ["Flex", "Flash", "AIR", "ColdFusion" ] );</li>
<li> [Bindable]</li>
<li> public var users:ArrayCollection = new ArrayCollection( ["John", "Paul", "George", "Ringo" ] );</li>
<li> [Bindable]</li>
<li> public var currentRoom:String;</li>
<li> [Bindable]</li>
<li> public var messages:String = &#8220;&#8221;;</li>
<li> private function joinRoom( room:String ):void</li>
<li> \{</li>
<li> currentRoom = room;</li>
<li> views.selectedChild = chatPanel;</li>
<li> \}</li>
<li> private function sendMessage( message:String ):void</li>
<li> \{</li>
<li> messages += message + &#8220;\\n&#8221;;</li>
<li> \}</li>
<li> ]]<span class="er">&gt;</span></li>
<li> <span class="ta">&lt;/mx:Script&gt;</span></li>
<li> <span class="ta">&lt;mx:ViewStack</span> <span class="an">id</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">views</span><span class="dl">&#8220;</span></span> <span class="an">resizeToContent</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">true</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span></li>
<li> <span class="ta">&lt;mx:Panel</span> <span class="an">title</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">Room List</span><span class="dl">&#8220;</span></span> <span class="an">width</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">300</span><span class="dl">&#8220;</span></span> <span class="an">height</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">400</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span></li>
<li> <span class="ta">&lt;mx:VBox</span> <span class="an">width</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span> <span class="an">height</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span></li>
<li> <span class="ta">&lt;mx:List</span> <span class="an">id</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">roomList</span><span class="dl">&#8220;</span></span> <span class="an">width</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span> <span class="an">height</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span></li>
<li> <span class="an">borderSides</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">top</span><span class="dl">&#8220;</span></span> <span class="an">dataProvider</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">\{rooms\}</span><span class="dl">&#8220;</span></span><span class="ta">/&gt;</span></li>
<li> <span class="ta">&lt;mx:Button</span> <span class="an">width</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span> <span class="an">label</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">Chat</span><span class="dl">&#8220;</span></span> <span class="an">enabled</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">\{roomList.selectedItem != null\}</span><span class="dl">&#8220;</span></span></li>
<li> <span class="an">click</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">joinRoom(roomList.selectedItem as String)</span><span class="dl">&#8220;</span></span><span class="ta">/&gt;</span></li>
<li> <span class="ta">&lt;/mx:VBox&gt;</span></li>
<li> <span class="ta">&lt;/mx:Panel&gt;</span></li>
<li> <span class="ta">&lt;mx:Panel</span> <span class="an">title</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">Topic: \{currentRoom\}</span><span class="dl">&#8220;</span></span> <span class="an">id</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">chatPanel</span><span class="dl">&#8220;</span></span> <span class="an">width</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">500</span><span class="dl">&#8220;</span></span> <span class="an">height</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">400</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span></li>
<li> <span class="ta">&lt;mx:HBox</span> <span class="an">width</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span> <span class="an">height</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span> <span class="an">paddingLeft</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">10</span><span class="dl">&#8220;</span></span> <span class="an">paddingBottom</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">10</span><span class="dl">&#8220;</span></span></li>
<li> <span class="an">paddingRight</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">10</span><span class="dl">&#8220;</span></span> <span class="an">paddingTop</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">10</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span></li>
<li> <span class="ta">&lt;mx:VBox</span> <span class="an">width</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">150</span><span class="dl">&#8220;</span></span> <span class="an">height</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span></li>
<li> <span class="ta">&lt;mx:Label</span> <span class="an">text</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">User List</span><span class="dl">&#8220;</span></span><span class="ta">/&gt;</span></li>
<li> <span class="ta">&lt;mx:List</span> <span class="an">width</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span> <span class="an">height</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span> <span class="an">dataProvider</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">\{users\}</span><span class="dl">&#8220;</span></span><span class="ta">/&gt;</span></li>
<li> <span class="ta">&lt;/mx:VBox&gt;</span></li>
<li> <span class="ta">&lt;mx:VBox</span> <span class="an">width</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span> <span class="an">height</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span> <span class="ta">&gt;</span></li>
<li> <span class="ta">&lt;mx:Label</span> <span class="an">text</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">Chat</span><span class="dl">&#8220;</span></span><span class="ta">/&gt;</span></li>
<li> <span class="ta">&lt;mx:TextArea</span> <span class="an">id</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">chatText</span><span class="dl">&#8220;</span></span> <span class="an">text</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">\{messages\}</span><span class="dl">&#8220;</span></span></li>
<li> <span class="an">editable</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">false</span><span class="dl">&#8220;</span></span> <span class="an">width</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span> <span class="an">height</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span> <span class="an">wordWrap</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">true</span><span class="dl">&#8220;</span></span><span class="ta">/&gt;</span></li>
<li> <span class="ta">&lt;mx:HBox</span> <span class="an">width</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span></li>
<li> <span class="ta">&lt;mx:TextInput</span> <span class="an">id</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">messageInput</span><span class="dl">&#8220;</span></span> <span class="an">width</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span> <span class="an">minWidth</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">0</span><span class="dl">&#8220;</span></span><span class="ta">/&gt;</span></li>
<li> <span class="ta">&lt;mx:Button</span> <span class="an">label</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">Send</span><span class="dl">&#8220;</span></span> <span class="an">click</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">sendMessage( messageInput.text )</span><span class="dl">&#8220;</span></span><span class="ta">/&gt;</span></li>
<li> <span class="ta">&lt;/mx:HBox&gt;</span></li>
<li> <span class="ta">&lt;/mx:VBox&gt;</span></li>
<li> <span class="ta">&lt;/mx:HBox&gt;</span></li>
<li> <span class="ta">&lt;/mx:Panel&gt;</span></li>
<li> <span class="ta">&lt;/mx:ViewStack&gt;</span></li>
<li><span class="ta">&lt;/mx:Application&gt;</span></li>
</ol>
<p>The above example application is a classic example of how most of us start out developing in Flex, we end up putting all our properties and event handlers in the same file. This may be fine for a tiny application but if we want to scale it up we are going to run into problems.</p>
<p>For example, Flex offers us the ability to create a custom <span class="caps"><span class="caps">MXML</span></span> component, that we can then reuse through our application, so as Tom showed, maybe we want to take the code that displays the Room list (above) and copy this into a separate mxml component . We can easily cut and paste the code and create a new <span class="caps"><span class="caps">MXML</span></span> file RoomList.mxml with the following code:</p>
<ol class="CodeRay">
<li><span class="pp">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;</span></li>
<li><span class="ta">&lt;mx:Panel</span> <span class="an">title</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">Room List</span><span class="dl">&#8220;</span></span> <span class="an">xmlns:mx</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">http://www.adobe.com/2006/mxml</span><span class="dl">&#8220;</span></span> <span class="an">width</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">300</span><span class="dl">&#8220;</span></span> <span class="an">height</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">400</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span></li>
<li>    <span class="ta">&lt;mx:VBox</span> <span class="an">width</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span> <span class="an">height</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span></li>
<li>    <span class="ta">&lt;mx:List</span> <span class="an">id</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">roomList</span><span class="dl">&#8220;</span></span> <span class="an">width</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span> <span class="an">height</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span></li>
<li>            <span class="an">borderSides</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">top</span><span class="dl">&#8220;</span></span> <span class="an">dataProvider</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">{rooms}</span><span class="dl">&#8220;</span></span><span class="ta">/&gt;</span></li>
<li>    <span class="ta">&lt;mx:Button</span> <span class="an">width</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span> <span class="an">label</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">Chat</span><span class="dl">&#8220;</span></span> <span class="an">enabled</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">{roomList.selectedItem != null}</span><span class="dl">&#8220;</span></span></li>
<li>            <span class="an">click</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">joinRoom(roomList.selectedItem as String)</span><span class="dl">&#8220;</span></span><span class="ta">/&gt;</span></li>
<li>  <span class="ta">&lt;/mx:VBox&gt;</span></li>
<li><span class="ta">&lt;/mx:Panel&gt;</span></li>
</ol>
<p>The problem is that we now have introduced two errors as the ArrayCollection ‘rooms’ is no longer in this mxml file then we cannot bind to it as the dataProvider for the roomList, also the event handler ‘joinRoom’ is no longer accessible. We could move these into this file, but then they couldn’t access the view stack and the problem goes on. So what we really need is to centralise our data into a central model and also centralise our even handlers into a controller.</p>
<h2>Centralising Data into a Model</h2>
<p>To centralise data, Tom took the Cairngorm’s modelLocator pattern, based around a <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a> . Where by the singleton ensures there is only ever one instance of itself, we define our Model as follows:</p>
<ol class="CodeRay">
<li><span class="r">package</span> com.chatopica.chat.model</li>
<li>{</li>
<li>  <span class="r">public</span> <span class="r">class</span> ChatModel</li>
<li>  {</li>
<li>    <span class="r">private</span> <span class="r">static</span> <span class="r">var</span> instance:ChatModel;</li>
<li>    <span class="r">public</span> <span class="r">function</span> ChatModel()</li>
<li>    {</li>
<li>      <span class="r">if</span>( instance != <span class="pc">null</span> )</li>
<li>      {</li>
<li>        <span class="r">throw</span>( new Error( <span class="s"><span class="dl">&#8220;</span><span class="k">there can be only one instance of ChatModel</span><span class="dl">&#8220;</span></span> ) );</li>
<li>      }</li>
<li>    }</li>
<li>    <span class="r">public</span> <span class="r">static</span> <span class="r">function</span> getInstance():ChatModel</li>
<li>    {</li>
<li>      <span class="r">if</span>( instance == <span class="pc">null</span> )</li>
<li>      {</li>
<li>        instance = new ChatModel();</li>
<li>      }</li>
<li>      <span class="r">return</span> instance;</li>
<li>    }</li>
<li>  }</li>
<li>}</li>
</ol>
<p>This is a typical singleton, implemented in ActionScript 3. As Tom pointed out in the eSeminar, ActionScript does not allow for private constructors, so here he is throwing an error if we try and instantiate the class and it is already instantiated. We can now access this Model anywhere in our application by simply typing</p>
<ol class="CodeRay">
<li>ChatModel.getInstance()</li>
</ol>
<p>So the next thing to do is move our ArrayCollection rooms into the Model so we end up with the following:</p>
<ol class="CodeRay">
<li><span class="r">package</span> com.chatopica.chat.model</li>
<li>{</li>
<li>  <span class="r">import</span> mx.collections.ArrayCollection;</li>
<li>  <span class="r">public</span> <span class="r">class</span> ChatModel</li>
<li>  {</li>
<li>    <span class="r">private</span> <span class="r">static</span> <span class="r">var</span> instance:ChatModel;</li>
<li>    [Bindable]</li>
<li>    <span class="r">public</span> <span class="r">var</span> rooms:ArrayCollection = new ArrayCollection( [ new Room(<span class="s"><span class="dl">"</span><span class="k">Flex</span><span class="dl">"</span></span>), new Room(<span class="s"><span class="dl">"</span><span class="k">Flash</span><span class="dl">"</span></span>), new Room(<span class="s"><span class="dl">"</span><span class="k"><span class="caps">AIR</span></span><span class="dl">"</span></span>), new Room(<span class="s"><span class="dl">"</span><span class="k">ColdFusion</span><span class="dl">"</span></span>) ] );</li>
<li>    <span class="r">public</span> <span class="r">function</span> ChatModel()</li>
<li>    {</li>
<li>      <span class="r">if</span>( instance != <span class="pc">null</span> )</li>
<li>      {</li>
<li>        <span class="r">throw</span>( new Error( <span class="s"><span class="dl">&#8220;</span><span class="k">there can be only one instance of ChatModel</span><span class="dl">&#8220;</span></span> ) );</li>
<li>      }</li>
<li>    }</li>
<li>    <span class="r">public</span> <span class="r">static</span> <span class="r">function</span> getInstance():ChatModel</li>
<li>    {</li>
<li>      <span class="r">if</span>( instance == <span class="pc">null</span> )</li>
<li>      {</li>
<li>        instance = new ChatModel();</li>
<li>      }</li>
<li>      <span class="r">return</span> instance;</li>
<li>    }</li>
<li>  }</li>
<li>}</li>
</ol>
<p>Because our ArrayCollection is now in the Model that we can access from anywhere. We can change the mx:List ‘roomList’ in RoomList.mxml to use the rooms ArrayCollection in the Model as the dataProvider as follows:</p>
<ol class="CodeRay">
<li><span class="ta">&lt;mx:List</span> <span class="an">id</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">roomList</span><span class="dl">&#8220;</span></span> <span class="an">width</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span> <span class="an">height</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span>  <span class="an">borderSides</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">top</span><span class="dl">&#8220;</span></span> <span class="an">dataProvider</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">{ChatModel.getInstance().rooms}</span><span class="dl">&#8220;</span></span><span class="ta">/&gt;</span></li>
</ol>
<p>We have now fixed the first issue but we still have the issue of the click handler for the button being inaccessible. We can solve this by centralising our events into a Controller</p>
<h2>Centralising Events into a Controller</h2>
<p>As with many event driven languages, ActionScript has a handy feature known as event bubbling. When an event is fired in a container, if the event has been set to bubble (by default events don’t bubble) it will also fire on it’s parent container, and in turn fire on the grandparent container all the way up to the main Application <span class="caps"><span class="caps">MXML</span></span> class. By bubbling events, we can register event listeners on the System Manager and listen for any global application events that are set to bubble. So we can dispatch an event anywhere in our application using the following, and we can listen for it on the System Manager:</p>
<ol class="CodeRay">
<li>dispatchEvent(new Event(<span class="s"><span class="dl">‘</span><span class="k">myEvent</span><span class="dl">‘</span></span>, <span class="pc">true</span>))</li>
</ol>
<p><em>Note:</em> We have set the second parameter (bubbles) on the Event constructor to true, which tells the event dispatcher to bubble this event.</p>
<p>As we are centralising our events we may need to send related information along with the event, for use by the event handler. For example, as the event handler is no longer able to directly query the roomList, to see which item has been selected (i.e. roomList.selectedItem), we need to send this information with the event. We can easily do this by creating a custom event that extends the Event class as follows:</p>
<ol class="CodeRay">
<li><span class="r">package</span> com.chatopica.chat.events</li>
<li>{</li>
<li>  <span class="r">import</span> com.chatopica.chat.model.Room;</li>
<li>  <span class="r">import</span> flash.events.Event;</li>
<li>  <span class="r">public</span> <span class="r">class</span> JoinRoomEvent <span class="r">extends</span> Event</li>
<li>  {</li>
<li>    <span class="r">public</span> <span class="r">static</span> <span class="r">const</span> JOIN:<span class="pt">String</span> = <span class="s"><span class="dl">&#8220;</span><span class="k">joinRoom</span><span class="dl">&#8220;</span></span>;</li>
<li>    <span class="r">public</span> <span class="r">var</span> room:Room;</li>
<li>    <span class="r">public</span> <span class="r">function</span> JoinRoomEvent( room:Room )</li>
<li>    {</li>
<li>      <span class="pc">super</span>( <span class="caps">JOIN</span>, <span class="pc">true</span> );</li>
<li>      <span class="pc">this</span>.room = room;</li>
<li>    }</li>
<li>  }</li>
<li>}</li>
</ol>
<p>Above we have simply extended the event using inheritance and have added a public property called room (of type Room, Tom has created a Room class that holds the name as well as a collection of Users). We have also declared the event name/type as a constant <span class="caps"><span class="caps">JOIN</span></span> = “joinRoom”. This allows us to reference this event anywhere. In our constructor, we call the constructor on the parent class (Event) setting the event name/type to “joinRoom” and stating that it should bubble (like this we don’t have to specify that it bubbles when we create a new JoinRoomEvent). We then set the room property from the parameter passed to the constructor.</p>
<p>So now we can fire a JoinRoomEvent anywhere in our application, passing in a room object. The event handler listening for this event will have access to this room object. So we can fix the last error in RoomList.mxml as follows:</p>
<ol class="CodeRay">
<li><span class="ta">&lt;mx:Button</span> <span class="an">width</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">100%</span><span class="dl">&#8220;</span></span> <span class="an">label</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">Chat</span><span class="dl">&#8220;</span></span> <span class="an">enabled</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">{roomList.selectedItem != null}</span><span class="dl">&#8220;</span></span></li>
<li>      <span class="an">click</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">dispatchEvent( new JoinRoomEvent( roomList.selectedItem as Room ) )</span><span class="dl">&#8220;</span></span><span class="ta">/&gt;</span></li>
</ol>
<p>So far we have created a custom event and we have discussed where to look to find bubbling events but we have not looked at how to do this.</p>
<h2>The Controller</h2>
<p>As I mentioned before, we can listen to all events that have been set to bubble on the systemManager and as UIComponent (anyone who has created a custom component will know this one) has a reference to systemManager within it, we can extend this class. The other benefit of extending UIComponent for our class that will be our central event handler or Controller is that we can then use it in <span class="caps"><span class="caps">MXML</span></span>.</p>
<p>We extend the UIComponent as follows:</p>
<ol class="CodeRay">
<li><span class="r">package</span> com.chatopica.chat.controller</li>
<li>{</li>
<li>  <span class="r">import</span> com.chatopica.chat.events.JoinRoomEvent;</li>
<li>  <span class="r">import</span> com.chatopica.chat.events.SendMessageEvent;</li>
<li>  <span class="r">import</span> com.chatopica.chat.model.ChatModel;</li>
<li>  <span class="r">import</span> flash.events.Event;</li>
<li>  <span class="r">import</span> mx.core.UIComponent;</li>
<li>  <span class="r">import</span> mx.events.FlexEvent;</li>
<li>  <span class="r">public</span> <span class="r">class</span> ChatController <span class="r">extends</span> UIComponent</li>
<li>  {</li>
<li>    <span class="r">public</span> <span class="r">function</span> ChatController()</li>
<li>    {</li>
<li>      addEventListener( FlexEvent.CREATION_COMPLETE, setupEventListeners );</li>
<li>    }</li>
<li>    <span class="r">private</span> <span class="r">function</span> setupEventListeners( <span class="pt">event</span>:Event ):<span class="r">void</span></li>
<li>    {</li>
<li>      systemManager.addEventListener( JoinRoomEvent.JOIN, handle_joinRoom );</li>
<li>    }</li>
<li>    <span class="r">private</span> <span class="r">function</span> handle_joinRoom( <span class="pt">event</span>:JoinRoomEvent ):<span class="r">void</span></li>
<li>    {</li>
<li>      ChatModel.getInstance().currentActivity = ChatModel.VIEWING_CHAT;</li>
<li>    }</li>
<li>  }</li>
<li>}</li>
</ol>
<p><em>Note::</em> Above we have not directly added an event listener to the systemManager in the ChatController constructor. In fact we can’t to do this, because at the time the class is instantiated the systemManager is not initialised and is Null. We would therefore be adding an event listener to nothing. We get around this by adding an event listener for the global FlexEvent.CREATION_COMPLETE event, and at th