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

<channel>
	<title>FlexBandit &#187; Projects</title>
	<atom:link href="http://flexbandit.com/archives/category/projects/feed" rel="self" type="application/rss+xml" />
	<link>http://flexbandit.com</link>
	<description>Yet another Flex enthusiast? You Betcha!</description>
	<lastBuildDate>Thu, 13 May 2010 16:58:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Vote Zentrack Now!</title>
		<link>http://flexbandit.com/archives/64</link>
		<comments>http://flexbandit.com/archives/64#comments</comments>
		<pubDate>Sat, 23 May 2009 23:05:33 +0000</pubDate>
		<dc:creator>donkeybandit</dc:creator>
				<category><![CDATA[Zentrack]]></category>

		<guid isPermaLink="false">http://flexbandit.com/?p=64</guid>
		<description><![CDATA[The community choice awards are an opportunity to vote for fantastic open source software. For me Zentrack has been such a useful tool that it certainly got my vote! Please click the award link if you want to vote too.]]></description>
			<content:encoded><![CDATA[<p><a href="http://sourceforge.net/community/cca09/nominate/?project_name=ZenTrack&amp;project_url=http://zentrack.com/"><img src="http://sourceforge.net/images/cca/cca_nominate.png" border="0" alt="" /></a>The community choice awards are an opportunity to vote for fantastic open source software. For me Zentrack has been such a useful tool that it certainly got my vote! Please click the award link if you want to vote too.</p>
]]></content:encoded>
			<wfw:commentRss>http://flexbandit.com/archives/64/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zentrack Customer Front End</title>
		<link>http://flexbandit.com/archives/47</link>
		<comments>http://flexbandit.com/archives/47#comments</comments>
		<pubDate>Fri, 19 Dec 2008 13:40:13 +0000</pubDate>
		<dc:creator>donkeybandit</dc:creator>
				<category><![CDATA[Flex Info]]></category>
		<category><![CDATA[Zentrack]]></category>
		<category><![CDATA[Cairngorm]]></category>

		<guid isPermaLink="false">http://flexbandit.com/?p=47</guid>
		<description><![CDATA[I promised a while back that I would publish the new prototype front end for Zentrack. This initial version is written using the Cairngorm MVC framework and you can play with an early release here if you like The Flex front end interfaces to the traditional HTML version via an API that Kato and I [...]]]></description>
			<content:encoded><![CDATA[<p>I promised a while back that I would publish the new prototype front end for Zentrack. This initial version is written using the Cairngorm MVC framework and you can play with an early release <a href="http://flexbandit.com/zt/">here</a> if you like <img src='http://flexbandit.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> <span id="more-47"></span></p>
<p>The Flex front end interfaces to the traditional HTML version via an API that Kato and I developed.  To see how the two tools interact, you can see the HTML version <a href="http://flexbandit.com/ZentrackDPD6/">here</a>. As I have been getting a lot of spam and attacks lately, I won&#8217;t be giving out the login details openly but you can leave a comment or contact me via the <a href="http://flexbandit.com/contact">contact page</a> and I&#8217;ll send you the details. If you would prefer to stay anonymous, <a href="http://flexbandit.com/live-chat">live chat</a> is also an option.</p>
<p>You can get hold of the latest version of the source code at SourceForge in the <a href="https://sourceforge.net/svn/?group_id=22724">Zentrack SVN Repository</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://flexbandit.com/archives/47/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Search Engine Capability</title>
		<link>http://flexbandit.com/archives/46</link>
		<comments>http://flexbandit.com/archives/46#comments</comments>
		<pubDate>Sat, 13 Dec 2008 11:49:35 +0000</pubDate>
		<dc:creator>donkeybandit</dc:creator>
				<category><![CDATA[Clarisolve]]></category>
		<category><![CDATA[Flex Info]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[htmlText]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://flexbandit.com/?p=46</guid>
		<description><![CDATA[Flash Player 10 has been out for a while now, so I decided to test the claims that Google and other search engines can now effectively crawl the Text inside a SWF. Historically, I found that a SWF would be identified but would not be displayed correctly in the search results. This has now been [...]]]></description>
			<content:encoded><![CDATA[<p>Flash Player 10 has been out for a while now, so I decided to test the claims that Google and other search engines can now effectively crawl the Text inside a SWF. Historically, I found that a SWF would be identified but would not be displayed correctly in the search results. This has now been solved.<span id="more-46"></span></p>
<p>To test the functionality I searched for &#8220;Clarisolve&#8221; in Google, which has a lot of freely visible text and did not display correctly before FP10. I then entered the search string &#8220;Clarisolve ClearCollect&#8221; and the results displayed from a specific page on the site. Clarisolve has an html shadow site so I checked to see if it was being picked up instead of the flash version. The results actually displayed both the html and SWF version.</p>
<p>At this time unfortunately I have not implemented deep linking on the Clarisolve site, so no matter what you choose in Google it will always go to the home page. Still this is better than a blank SWF that barely caches right?</p>
<p>The next step will be to determine how SEO works with Flash/Flex text has we don&#8217;t have the luxury of traditional html text to add &#8220;h&#8221; tags.</p>
]]></content:encoded>
			<wfw:commentRss>http://flexbandit.com/archives/46/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zentrack Goes Cairngorm</title>
		<link>http://flexbandit.com/archives/32</link>
		<comments>http://flexbandit.com/archives/32#comments</comments>
		<pubDate>Sun, 31 Aug 2008 23:17:11 +0000</pubDate>
		<dc:creator>donkeybandit</dc:creator>
				<category><![CDATA[Zentrack]]></category>
		<category><![CDATA[Cairngorm]]></category>

		<guid isPermaLink="false">http://flexbandit.com/?p=32</guid>
		<description><![CDATA[This weekend I revisited the Cairngorm MVC structure ready for use in the Zentrack project. I went back to the excellent set of articles written by Steven Webster at the Adobe devnet site and read through a Flex 3 PDF version too. As part of my work for DPD I created a prototype front end, [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend I revisited the Cairngorm MVC structure ready for use in the Zentrack project. I went back to the excellent <a href="http://www.adobe.com/devnet/flex/articles/cairngorm_pt1.html">set of articles</a> written by Steven Webster at the Adobe devnet site and read through a <a href="http://www.adobe.com/devnet/flex/articles/introducing_cairngorm/introducing_cairngorm.pdf">Flex 3 PDF version</a> too. As part of my work for DPD I created a prototype front end, which I have now started re-factoring into a Cairngorm structure. I plan to release the code in approximately one week.</p>
<p>There are a lot of tutorials for Cairngorm already on the web, so I don&#8217;t feel the need to reiterate someone elses good work. Instead, when I release the code for Zentrack (Liger) I&#8217;ll point out any of the tricky problems I solved that may be of use to others.</p>
]]></content:encoded>
			<wfw:commentRss>http://flexbandit.com/archives/32/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Builder 3 (alpha) on Linux</title>
		<link>http://flexbandit.com/archives/12</link>
		<comments>http://flexbandit.com/archives/12#comments</comments>
		<pubDate>Sat, 05 Jul 2008 23:42:09 +0000</pubDate>
		<dc:creator>donkeybandit</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Zentrack]]></category>

		<guid isPermaLink="false">http://flexbandit.com/?p=12</guid>
		<description><![CDATA[Today I installed Flex Builder 3 on Linux. This means that very soon I will no longer be tied to my Windows laptop for Flex development, which I think is marvelous news. As much as I like Windows XP media center edition, for development purposes it isn&#8217;t ideal. Flex Builder for Linux also has great [...]]]></description>
			<content:encoded><![CDATA[<p>Today I installed Flex Builder 3 on Linux. This means that very soon I will no longer be tied to my Windows laptop for Flex development, which I think is marvelous news. As much as I like Windows XP media center edition, for development purposes it isn&#8217;t ideal.</p>
<p>Flex Builder for Linux also has great significance for the Zentrack project too, due to the fact that developers will be able to edit and recompile the new Flex front end on all of the major platforms (Linux, Mac &amp; Windows).</p>
<p><span id="more-12"></span>After installation I created two test projects, one browser based project and the other an AIR application. The first thing you notice is the lack of the designer view, which isn&#8217;t terrible news to a seasoned Flex developer but isn&#8217;t great for newbies. I found that when I was originally learning Flex, the designer was very useful for giving me a nice list of the components available and a visual way of organising them.</p>
<p>I was thrilled to see that the code completion functionality works properly as well as the syntax highlighting. The friendly &#8220;Flex Start Page&#8221; was also available and all of the main functionality that you would expect, including the debugger. It seems that the decision to develop the tools in Java is paying off, but perhaps the full platform independence that one comes to expect from Java isn&#8217;t quite there yet.</p>
<p>Not all of the features are included, below are the main ones that are missing:</p>
<ul>
<li>Design view</li>
<li>States view</li>
<li>Refactoring</li>
<li>Data Wizards</li>
<li>Cold Fusion &#8211; Data Services Wizard</li>
<li>Web Services introspection</li>
<li>Profiler</li>
</ul>
<p>Most of these tools are time savers (with the exception of the Profiler) and not essential for the creation of projects, but I know I would really miss the &#8220;States view&#8221; functionality.</p>
<p>In time I shall try importing each of my projects into the Linux version of Flex Builder and determine once and for all if I can give my poor wheezing laptop a well earned break.</p>
<p>To summarise, my first impressions of Flex Builder for Linux are very positive. The Flex plugin plays nicely with the other plugins and considering this is an alpha version, it is looking very slick already.</p>
<p>My Configuration:</p>
<ul>
<li>Linux &#8211; Ubuntu 8.04 (the Hardy Heron)</li>
<li>Eclipse 3.3.2 (installed from the PDT package)</li>
</ul>
<p>For more information, see the <a title="Adobe Flex Builder 3 for Linux - Official page" href="http://labs.adobe.com/technologies/flex/flexbuilder_linux/" target="_self">official Adobe page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://flexbandit.com/archives/12/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Flex Site with SEO in Mind</title>
		<link>http://flexbandit.com/archives/7</link>
		<comments>http://flexbandit.com/archives/7#comments</comments>
		<pubDate>Mon, 30 Jun 2008 18:14:26 +0000</pubDate>
		<dc:creator>donkeybandit</dc:creator>
				<category><![CDATA[Clarisolve]]></category>
		<category><![CDATA[Flex Info]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://matt.was-here.org/?p=7</guid>
		<description><![CDATA[- Part 1 &#8211; Creating a Shadow Site Creating a beautiful web 2.0 website in Flash/Flex is very satisfying. I really enjoy the development time savings of Flex versus that of general HTML/javascript solutions and the crispness of the interfaces created. The pleasure of Flex development is something I can talk about for hours and [...]]]></description>
			<content:encoded><![CDATA[<p>-</p>
<h1>Part 1 &#8211; Creating a Shadow Site</h1>
<p>Creating a beautiful web 2.0 website in Flash/Flex is very satisfying. I really enjoy the development time savings of Flex versus that of general HTML/javascript solutions and the crispness of the interfaces created. The pleasure of Flex development is something I can talk about for hours and I have even been known to evangelise in my local bar on a Friday night.</p>
<p>It&#8217;s not all roses though, as Flex solutions do come with one major flaw; They are not search engine friendly (for a number of reasons). Part 1 of this article explores a solution using a &#8220;<strong>Shadow Site</strong>&#8220;, which is a term I surfed across recently and feel it accurately describes the subject. <span id="more-7"></span></p>
<h1>The Problem</h1>
<p>You are probably already aware of the issues associated with <a title="Wikipedia definition of " href="http://en.wikipedia.org/wiki/Search_engine_optimization" target="_blank">SEO (Search Engine Optimisation)</a> and Flex, but just in case this is a new concept for you I will briefly explain the issues that are Flex related:</p>
<h2>Pure Flash/Flex sites are not crawled for search text</h2>
<p>As your SWF is basically a compiled program that is executed through the Flash Player, for a search engine to be able to read any embedded content it would have to effectively decompile your <a title="Wikipedia definition of " href="http://en.wikipedia.org/wiki/SWF" target="_self">SWF</a>. This is a problem for a number of reasons:</p>
<ul>
<li>Google doesn&#8217;t do it (presently)</li>
<li>developers may choose a Flash solution as a means of <a title="Wikipedia definition of " href="http://en.wikipedia.org/wiki/Obfuscation" target="_self">obfuscation </a>(compared to alternative <a title="Wikipedia definition of " href="http://en.wikipedia.org/wiki/Web_2.0" target="_self">web 2.0</a> strategies) so don&#8217;t want their precious code available to the world</li>
<li>the Flash Player/<a title="Wikipedia definition of " href="http://en.wikipedia.org/wiki/SWF" target="_self">SWF</a> standard is owned by Adobe and it is debatable whether it should be decompilable (see point above)</li>
<li>decompilation would cause a large processing overhead for a search engine crawler</li>
</ul>
<h2>Pure Flex solutions are all inclusive within a single SWF structure</h2>
<p>When you compile your Flex programs they ultimately produce a single <a title="Wikipedia definition of " href="http://en.wikipedia.org/wiki/SWF" target="_self">SWF</a> file (not including all of the associated html, javascript, shared resource files, etc.). This single file contains the whole program (and therefore navigation structure) so there is no need to leave the <a title="Wikipedia definition of " href="http://en.wikipedia.org/wiki/SWF" target="_self">SWF</a> just because you are moving to a different page, effectively making the whole URL structure irrelevant. Although this has a lot of advantages, it makes linking to a particular point in your application something you really have to think about. That particular problem is solved in Flex 3 with the improved &#8220;<a title="Wikipedia definition of " href="http://en.wikipedia.org/wiki/Deep_linking" target="_self">Deep Linking</a>&#8221; functionality, but <strong>how does a search engine know about your deep links?</strong></p>
<h1>A Solution</h1>
<p>What I have currently implemented as a solution on the <a title="Clarisolve Web Site" href="http://www.clarisolve.com/" target="_blank">Clarisolve project</a> is a &#8220;shadow site&#8221;. Historically the term &#8220;HTML version&#8221; or &#8220;Text only&#8221; has been used, but in this case the symantics are slightly different because I don&#8217;t really want people to see underlying site, I only want the search engine to. In my implementation, the shadow site is basically a WordPress blog used as a content manager with all the relevant HTML articles stored in the associated MySQL database. <a title="WordPress home page" href="http://wordpress.org/" target="_self">WordPress 2.5.1</a> offers a number of interfaces with which to extract the pages and articles, so I can very easily use the same source text in my Flex application too. <a title="WordPress home page" href="http://wordpress.org/" target="_self">WordPress</a> also has a great publishing element and user manager, so makes for a very rich content management system. You can of course use any CMS of your choice, but I chose WordPress.</p>
<p>The most important part to creating the shadow site is the javascript that queries the current version of Flash Player installed, then either displays the trailing HTML (derived from PHP) or redirects to the Flex version of the site. On redirect, the javascript also interprets the current URL parameters and rearranges them into a friendly format for &#8220;deep linking&#8221;.</p>
<p>The main reason for using WordPress is the great slug support, which is useful on Google as each page is separately displayed. Make sure that the &#8220;PermaLink&#8221; settings are not using the default format as historically search engines could not cope with GET notation very well.</p>
<p>Currently, this solution does need some polish as the way I have implemented it is fairly static, resulting in the RSS feed being broken. Solving the problem should be fairly simple by making the javascript text conditionally addable by a PHP function (based on the URL).</p>
<p>To see the shadow site you need to disable Flash in your browser. The easiest way I found to do this is to use Internet Explorer and go to the &#8220;Tools<strong>-&gt;</strong>Manage Add-ons<strong>-&gt;</strong>Enable or Disable Add-ons..&#8221; and disable the &#8220;Shockwave Flash Object&#8221;. At the time of writing, the HTML site is actually looking prettier than the Flex site but that will change in time <img src='http://flexbandit.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Hopefully that is all the information you&#8217;ll need to create your own shadow site.</p>
<p>The PHP/javascript for selecting whether to use the Flash or HTML looks like this:</p>
<pre>&lt;script src="/AC_OETags.js" language="Javascript"&gt;&lt;/script&gt;
&lt;script language="JavaScript" type="text/javascript"&gt;
&lt;!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// -----------------------------------------------------------------------------
// --&gt;
&lt;/script&gt;
&lt;script language="JavaScript" type="text/javascript"&gt;
&lt;!--
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);

// Version check based upon the values defined in globals
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
if ( hasProductInstall &amp;&amp; !hasRequestedVersion ) {
	// MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
	// This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
	// DO NOT MODIFY THE FOLLOWING FOUR LINES
	// Location visited after installation is complete if installation is required
	var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
	var MMredirectURL = window.location;
    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
    var MMdoctitle = document.title;

	AC_FL_RunContent(
		"src", "playerProductInstall",
		"FlashVars", "MMredirectURL="+MMredirectURL+'&amp;MMplayerType='+MMPlayerType+'&amp;MMdoctitle='+MMdoctitle+"",
		"width", "100%",
		"height", "100%",
		"align", "middle",
		"id", "ClarisolveWebSite_v2",
		"quality", "high",
		"bgcolor", "#869ca7",
		"name", "ClarisolveWebSite_v2",
		"allowScriptAccess","sameDomain",
		"type", "application/x-shockwave-flash",
		"pluginspage", "http://www.adobe.com/go/getflashplayer"
	);
} else if (hasRequestedVersion) {
    var strReturn = "";
    var strHref = window.location.href;
    if ( strHref.indexOf("/") &gt; -1 ){
        var aQueryString = strHref.split("/");
        for ( var iParam = aQueryString.length-1; iParam &gt; aQueryString.length-3; iParam-- ){
		    if ( isNaN(aQueryString[iParam]) ) {
	            strReturn += "page=" + aQueryString[iParam];
				iParam = 2;
			} else {
	            strReturn += "archives=" + aQueryString[iParam] + "&amp;";
			}
	    }
    }

    window.location = "/ClarisolveWebSite_v2.html#" + strReturn;
}
// --&gt;
&lt;/script&gt;
&lt;noscript&gt;
  	&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="ClarisolveWebSite_v2" width="100%" height="100%"
			codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
			&lt;param name="movie" value="ClarisolveWebSite_v2.swf" /&gt;
			&lt;param name="quality" value="high" /&gt;
			&lt;param name="bgcolor" value="#869ca7" /&gt;
			&lt;param name="allowScriptAccess" value="sameDomain" /&gt;
			&lt;embed src="ClarisolveWebSite_v2.swf" quality="high" bgcolor="#869ca7"
				width="100%" height="100%" name="ClarisolveWebSite_v2" align="middle"
				play="true"
				loop="false"
				quality="high"
				allowScriptAccess="sameDomain"
				type="application/x-shockwave-flash"
				pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
			&lt;/embed&gt;
	&lt;/object&gt;
&lt;/noscript&gt;

&lt;?php
define('WP_USE_THEMES', true);
require('./wordpress/wp-blog-header.php');
?&gt;</pre>
<h1>Conclusion</h1>
<p>SEO is quite a large subject, so I haven&#8217;t gone into the details of how to understand the inner workings of Google or the use of &#8220;&lt;strong&gt;&#8221; and &#8220;&lt;h1&gt;&#8221; tags. Instead I have concentrated on how to get your HTML recognised in a search engine and how to alter your URL to something more &#8220;Deep Link&#8221; friendly.</p>
<p>The next part of this article will be related to importing WordPress articles and deep linking.</p>
]]></content:encoded>
			<wfw:commentRss>http://flexbandit.com/archives/7/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Power Grid &#8211; MapTile Component</title>
		<link>http://flexbandit.com/archives/6</link>
		<comments>http://flexbandit.com/archives/6#comments</comments>
		<pubDate>Fri, 27 Jun 2008 13:43:35 +0000</pubDate>
		<dc:creator>donkeybandit</dc:creator>
				<category><![CDATA[Power Grid]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://matt.was-here.org/?p=6</guid>
		<description><![CDATA[The interactive map is the key component of Power Grid. As the initial version I am writing is for the &#8220;Atolla Mudulis&#8221; expansion, I have to compile a map that deals with multiple &#8220;tiles&#8221; in variable combinations. Also, the map needs to be movable and zoomable both with the mouse and via a button interface. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" style="margin: 5px; float: left;" src="http://flexbandit.com/powergrid/assets/board/A7.png" alt="Map Component" width="119" height="119" />The interactive map is the key component of Power Grid. As the initial version I am writing is for the &#8220;Atolla Mudulis&#8221; expansion, I have to compile a map that deals with multiple &#8220;tiles&#8221; in variable combinations. Also, the map needs to be movable and zoomable both with the mouse and via a button interface.</p>
<p>I tried two approaches to creating the map, one which involved the <em>TileContainer </em>and another which created a single image.<span id="more-6"></span></p>
<h2>The <em>TileContainer </em>Approach</h2>
<p>The advantage of using a <em>TileContainer </em>is that it deals with all of the mechanics of placing the tiles in the correct alignment (providing you specified the appropriate properties). Each Tile in the container maintains its original properties and can be identified in a MouseEvent. This would have a lot of advantages in a game that uses tiles (such as Carcassonne or even Dominoes) but does not serve the purposes of a game board too well. If no aspect resizing (i.e. zooming in/out) is required then the TileCointer would be satisfactory, but of course my game board does require this functionality.</p>
<h2>The <em>Image </em>Approach</h2>
<p>After wrestling with the <em>TileContainer </em>for a day, I decided to scrap this approach to the game board implementation in favour of a single image with multiple &#8220;hit areas&#8221; (i.e. one hit area per city). The advantages this gave me were:</p>
<ul>
<li>the <code>localX</code> and <code>localY</code> coordinates were preserved, even after resizing</li>
<li>problems with the MOUSE_OUT event were resolved when dragging the image around</li>
<li>more control over where each image tile was placed, i.e. no fighting with the <em>TileContainer </em>styles</li>
</ul>
<p>I created a class for the game board image called <em>MapTile</em> which extends the <em>Image</em> class.</p>
<p>The next challenge I faced after deciding to drop the <em>TileContainer </em>approach was how to deal with each image as it loaded. Initially I attempted a simple <em>for each</em> loop which added each image to the map, but this didn&#8217;t work due to the unpredictable time it takes to load each tile. I could have embedded the images, but I am trying to keep the size of the .swf down so opted to use a COMPLETE event which signalled the need to load the next tile. It works nicely, and in the current version allows you to watch each tile load into the map.</p>
<h2>Conclusion</h2>
<p>This was ultimately a pretty simple problem. I needed to create an image that could be used by the main map component to zoom in and out of, as well as drag operations. This class takes in the array of tiles to be used, then creates one image at run time.</p>
<h2><em>MapTile </em>Code</h2>
<p>All of the images used for the map board can be found <a title="in the Power Grid assets directory" href="http://matt.was-here.org/powergrid/assets/board/">here</a>.</p>
<p>The full code for the <em>MapTile</em> class is listed below:</p>
<pre>package com.gamecomponents
{
	import mx.controls.Image;
	import flash.events.Event;
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Loader;
	import flash.net.URLRequest;
	import flash.geom.Rectangle;
	import flash.geom.Point;
	import flash.display.Sprite;

	public class MapTile extends Image
	{
		private var mapBitmap:Bitmap;
		private var mapBitmapData:BitmapData;
		private var loader:Loader;

		private var row:int;
		private var column:int;
		private var creationCounter:int;
		private var tileChooser:Array;
		private var sideLength:int;

		// Location of tile images and file extension
		private const sourcePath:String  = "assets/board/";
		private const filenameExt:String = ".png";

		// All map tiles must be 500 pixels square
		private const tileWidth:int = 500;

		public function MapTile(inMapConfig:Array = null):void {
			if (inMapConfig == null) {
				tileChooser = [
					"A7", "B7", "C6",
					"D6", "E5", "F5",
					"G4", "H4", "I3",
				];
			} else {
				tileChooser = inMapConfig;
			}

			// Calculate how many tiles per side
			sideLength = Math.sqrt(tileChooser.length);

			row    = 0;
			column = 0;

			// Tiles are all currently 500 pixels square
			var mapSize:int = tileWidth * sideLength;
			mapBitmapData   = new BitmapData(mapSize, mapSize);
			mapBitmap       = new Bitmap();

			// Create map image
			creationCounter = 0;
			getNextTile();
		}

		private function getNextTile():Boolean {
			if (tileChooser.length &lt;= 0) {
				return false;
			}

			// Get the next tile in the array
			var tileName:String = tileChooser.shift();

			// Load new tile
			loader = new Loader();
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE, picLoaded);
			loader.load(new URLRequest(sourcePath + tileName + filenameExt));

			return true;
		}

		private function picLoaded(event:Event):void
		{
			// Define a BitmapData object with dimensions identical to the sprite
			var loadedBitmapData:BitmapData;
			loadedBitmapData = new BitmapData(loader.width, loader.height);
			// Draw the image into the BitmapData object.
			loadedBitmapData.draw(loader);

			mapBitmapData.copyPixels(loadedBitmapData,
									 new Rectangle(0, 0, tileWidth, tileWidth),
									 new Point(column * tileWidth, row * tileWidth)
			);

			mapBitmap   = new Bitmap(mapBitmapData);
			this.source = mapBitmap;

			if ((creationCounter+1)%sideLength == 0) {
				column = 0;
				row++;
			} else {
				column++;
			}

			creationCounter++;

			if (!getNextTile()) {
				// All tiles have been loaded
				loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, picLoaded);
			}
		}
	}
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://flexbandit.com/archives/6/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Power Grid &#8211; Project Goals</title>
		<link>http://flexbandit.com/archives/5</link>
		<comments>http://flexbandit.com/archives/5#comments</comments>
		<pubDate>Fri, 27 Jun 2008 10:25:54 +0000</pubDate>
		<dc:creator>donkeybandit</dc:creator>
				<category><![CDATA[Power Grid]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://matt.was-here.org/?p=5</guid>
		<description><![CDATA[The motivation and choice for the Power Grid project comes from extensive play of the original Power Grid board game by Friedemann Friese. My aim is to improve upon the original German implementation of the online version which I found unplayable. This post defines the application and purpose in a little detail.]]></description>
			<content:encoded><![CDATA[<p>-</p>
<h1>Purpose</h1>
<p>This project has primarily been initiated to demonstrate the following key Flex skills:</p>
<ul>
<li>General Flex aptitude</li>
<li>Flex Data Services</li>
<li>Messaging</li>
<li>PureMVC Framework</li>
<li>OO competence</li>
<li>Skinning</li>
<li>Rich Media</li>
<li>Video (if technically viable and appropriate)</li>
</ul>
<p>The motivation and choice for this project comes from extensive play of the original Power Grid board game by Friedemann Friese. My aim is to improve upon the original German implementation of the <a title="Funkenschlag by Brettspielwelt" href="http://www.brettspielwelt.de/Spiele/Funkenschlag/?nation=en" target="_blank">online version</a> which I found unplayable.<span id="more-5"></span></p>
<h1>Components</h1>
<p>The solution is broken into three main parts.</p>
<h2>Intro Screen</h2>
<p>The intro is purely for demonstrating animation and creativity. As the majority of Flex/Flash adopters are media companies, it is essential for me that this skill is demonstrated effectively.</p>
<h3>Animation Description</h3>
<p>At the start of the animation there is a long shot of a power station with a blue sky and the sound of birds singing. The scene then zooms in and the sound changes to that of fuel burning and smoke starts to emerge from the chimneys. The camera follows the smoke upwards as the sky turns darker, then pans downwards back to the power station. During the pan, the whole scene turns to black and white with a dark blue tint. The Power Grid logo then stamps onto the screen in full colour and pauses.</p>
<h2>Game Lobby</h2>
<p>There needs to be an area for people to meet up and set up individual games. This site isn&#8217;t being designed to be the next MSN gamin zone, so only a simple screen is required at present.</p>
<h3>Login Dialog</h3>
<p>If an unauthenticated visitor enters the site, they need to provide a name for themself so they can be recognised. A dialog box appears requesting that the person enter a unique username.</p>
<h3>User List</h3>
<p>Along the right hand side is a box with a list of users.</p>
<h3>Game Set Up</h3>
<p>A window showing games open/in progress.</p>
<h3>Main Chat Window</h3>
<p>IRC style chat. Individual chat windows do not seem necessary at this point as users could use other messaging tools such as Jabber instead.</p>
<h2>Game Board</h2>
<p>The main gaming area, once a game has been initiated from the lobby.</p>
<h3>Markets</h3>
<p>A thin vertical border on the left hand side with coloured numbered squares. Each square represents a power station card in the &#8220;actual market&#8221;. When the user hovers the mouse over the border, the full market is displayed.</p>
<h3>Map</h3>
<p>The map displays the game board itself and contains cities that can be interacted with. By using the mouse or a set of buttons, the user can pan the map and zoom in/out using the scroll wheel. Clicking on a city may result in a marker being placed on it at certain points in the game.</p>
<h3>Player Status</h3>
<p>Along the right hand side of the screen a minimised status of all players is displayed. They are listed in player order (as a result of stage 1). Hovering or clicking on a players stats results in a larger window appearing with more detail.</p>
<h3>Raw Materials</h3>
<p>At the bottom of the screen a horizontal border will be displayed with a summary indicator of each raw material. Hovering on the border results in the full display of currently available materials.</p>
<h3>Chat Area</h3>
<p>An IRC style area displaying any chat messages from players/observers.</p>
<h1>Game Mechanics</h1>
<p>The rules of the game are clearly defined in the Power Grid rule book (available with the physical board game).</p>
]]></content:encoded>
			<wfw:commentRss>http://flexbandit.com/archives/5/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prepare for Launch!</title>
		<link>http://flexbandit.com/archives/4</link>
		<comments>http://flexbandit.com/archives/4#comments</comments>
		<pubDate>Thu, 26 Jun 2008 19:04:31 +0000</pubDate>
		<dc:creator>donkeybandit</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://matt.was-here.org/?p=4</guid>
		<description><![CDATA[Recently I decided to build a portfolio of publicly displayable work in order to demonstrate my Flex prowess. You may ask why? Well, it&#8217;s pretty simple really (and obvious for that matter)&#8230; I need a job, but I want another Flex role. There&#8217;s nothing more irritating than trying to convince a potential customer/employer that you [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I decided to build a portfolio of publicly displayable work in order to demonstrate my Flex prowess. You may ask why? Well, it&#8217;s pretty simple really (and obvious for that matter)&#8230; I need a job, but I want another Flex role. There&#8217;s nothing more irritating than trying to convince a potential customer/employer that you have really got what it takes when all of your previous efforts remain under lock and key inside the battlements of your previous customer. So after some serious research I now recognise what I need to demonstrate and have devised a plan.<span id="more-4"></span></p>
<p>First of all, what skills/experience do I need to demonstrate?</p>
<ol>
<li>General Flex aptitude (MXML, CSS, ActionSctipt3)</li>
<li>Dealing with data (Web services, Flex Data Services/Flash Remoting, etc.)</li>
<li>Frameworks (Cairngorm, PureMVC, etc.)</li>
<li>OO competence</li>
<li>Charting</li>
<li>Large scale applications</li>
<li>Skinning</li>
<li>Rich Media</li>
<li>Video</li>
<li>Deep Linking</li>
</ol>
<p>Now how am I going to do it? Well, below are a number of projects I have initiated and I have associated the numbered points above to each one. This is all my own work and (at time of writing) needs a lot of polish:</p>
<ul>
<li><a title="ClearView" href="http://www.clarisolve.com/ClearView/main.html" target="_blank">ClearView</a> &#8211; Graphing example for a Telecoms Revenue Assurance project. (1, 2, 5)<a title="ClearView" href="http://www.clarisolve.com/ClearView/main.html" target="_blank"></a></li>
<li><a title="Clarisolve" href="http://www.clarisolve.com" target="_blank">Clarisolve</a> &#8211; Simple website using some nice Flex effects and custom components. Have a look at the &#8220;Ask the Experts&#8221; page for a neat FAQ component. (1, 2, 10) <strong>(in progress)</strong></li>
<li><a title="HavenShade" href="http://flexbandit.com/demo" target="_blank">HavenShade</a> &#8211; Complex website designed by a web designer using custom skins and some custom blogging components. (1, 2, 7) <strong>(in progress)</strong></li>
<li><a title="Power Grid" href="http://flexbandit.com/powergrid/PowerGrid.html" target="_blank">Power Grid</a> &#8211; Online multiplayer game (1, 2, 3, 4, 6, 7, 8 and maybe 9) <strong>(in progress)</strong></li>
</ul>
<p>The final and most important project to mention is <a title="Zentrack" href="http://www.zentrack.net" target="_blank">Zentrack</a> (an open source PM and trouble ticket tool), which I have devoted a considerable amount of time to. Currently, I am working with the original author of the tool to create a Flex front end for version 3. You can find me in the Zentrack forums as &#8220;donkeyb&#8221;.</p>
<p>I realise that games aren&#8217;t necessarily the best development work you can do to land a job in a telco or bank, but there is nothing better for demonstrating design eloquence and coding skill in one project. Hopefully the decision to implement &#8220;Power Grid&#8221; will work out!</p>
]]></content:encoded>
			<wfw:commentRss>http://flexbandit.com/archives/4/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
