<?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>ria-coder.com</title>
	<atom:link href="http://ria-coder.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://ria-coder.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 21 Apr 2010 19:35:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Calling all PHP Rockstars!</title>
		<link>http://ria-coder.com/blog/calling-all-php-rockstars</link>
		<comments>http://ria-coder.com/blog/calling-all-php-rockstars#comments</comments>
		<pubDate>Wed, 21 Apr 2010 19:35:08 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[amfphp]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=595</guid>
		<description><![CDATA[We’re looking for some skilled PHP developers to help us innovate with and improve on AMFPHP. If you think you’ve got the goods to help us get this project insanely powerful (but still simple and easy to use), drop us a line!]]></description>
			<content:encoded><![CDATA[<div>
<p>Hey everyone</p>
<p>We’re looking for some skilled <acronym title="Hypertext Preprocessor">PHP</acronym> developers to help us innovate with and improve on AMFPHP. If you think you’ve got the goods to help us get this project insanely powerful (but still simple and easy to use), drop us a line!</p>
<ul>
<li>
<div>Ariel Sommeria-klein &#8211; Project Lead (<a title="ariel@amfphp.me" href="mailto:ariel@amfphp.me">ariel@amfphp.me</a>)</div>
</li>
<li>
<div>Danny Kopping &#8211; Development Lead (<a title="mailto:danny@amfphp.me" href="mailto:mailto:danny@amfphp.me">danny@amfphp.me</a>)</div>
</li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/calling-all-php-rockstars/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Managing your Development Business for less than $50 / month</title>
		<link>http://ria-coder.com/blog/managing-your-development-business-for-less-than-50-dollars-per-month</link>
		<comments>http://ria-coder.com/blog/managing-your-development-business-for-less-than-50-dollars-per-month#comments</comments>
		<pubDate>Mon, 19 Apr 2010 20:43:37 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[services]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=590</guid>
		<description><![CDATA[In the process of running your own software development business - or any type of business for that matter, you need to keep on top of things]]></description>
			<content:encoded><![CDATA[<h1>Overview</h1>
<p>In the process of running your own software development business &#8211; or any type of business for that matter, you need to keep on top of things; dropping the ball for a day could land you in some trouble. Small-to-medium software development companies (consisting of between 1 and 30 people for example) are going to require the following services:</p>
<ul>
<li>Email</li>
<li>Source-code/Project/Time management</li>
<li>Document management</li>
<li>Meeting management</li>
<li>Billing &amp; accounting</li>
<li>Internal &amp; external communication (Instant messaging, VOIP)</li>
<li>Website Hosting</li>
</ul>
<p>If you, as a business owner or manager, have the power to control all of these services from your browser then you will have the peace of mind knowing that you&#8217;re on top of things.</p>
<p>Luckily, in this incredible world where Software-as-a-Service (SAAS) is booming at an astounding rate, keeping track of your business comes at a minimal cost: <strong>+- $30! </strong>Most of these services that i will talk about are web-based, which means that all your data will be stored <span style="text-decoration: underline;">offsite</span>. That last sentence will strike fear into the heart of any business manager &#8211; if he/she is ignorant about the inherent value of offsite storage and SSL-encryption. The fact is, storing your data offsite is a <strong>smarter option</strong>; offsite storage means that your data is hosted <em>outside of your physical office space</em>, which means that no matter what natural/unnatural disaster strikes your premises, your data &#8211; the <strong>fundamental part of your business </strong>- is safe. If you also make sure that these web-services communicate through an encrypted connection, then there really is nothing to worry about.</p>
<p>Let&#8217;s look at how we can get the most bang for our bucks with some of the best online tools available&#8230;</p>
<h2 style="font-size: 1.5em;">Email</h2>
<p>At the heart of every software development business is <strong>email</strong>&#8230; no suprises there<em>. </em>What will surprise you is the massive bill you&#8217;ll be happily stuck with by Microsoft or IBM if you use their <strong>Exchange</strong> or <strong>Lotus Notes</strong> services. There is a solution though&#8230; Enter <strong><a title="Gmail" href="http://gmail.com" target="_blank">Gmail</a> </strong>from <strong>Google</strong>. I&#8217;ve been using Gmail now for about a year, and i must say that it&#8217;s a tremendous improvement over Microsoft Outlook. Here&#8217;s why i love <strong>Gmail</strong>:</p>
<ul>
<li>The ability to add as many POP/IMAP accounts to your Gmail account &#8211; consolidating all your email into one sleek interface. Not only can it pull from all of your other POP/IMAP accounts, but you can also send from them too! I&#8217;ve got 5 email accounts all running through Gmail and i can send email from any one i like.</li>
<li>Amazing spam filter</li>
<li>Integrated chat</li>
<li>Labels &amp; filters &#8211; you can customize Gmail to automatically label emails by search terms. For example, i&#8217;m the development leader on an open-source framework called <a title="AMFPHP" href="http://sourceforge.net/projects/amfphp" target="_blank">AMFPHP</a>. If i send or receive an email containing &#8220;amfphp&#8221;, it gets labelled as &#8220;AMFPHP&#8221; and neatly filed with all my other emails matching that search query.</li>
<li>Outside access &#8211; i&#8217;ve got an HTC Hero which has a Gmail application installed, which means i can access my Gmail from my phone</li>
<li>Integration with <a title="Google Contacts" href="http://contacts.google.com" target="_blank">Google Contacts</a>, <a title="Google Docs" href="http://docs.google.com" target="_blank">Google Docs</a> &amp; <a href="http://calendar.google.com">Google Calendar</a></li>
<li>&gt; 7GB storage!</li>
<li>Extremely fast search (c&#8217;mon, this <em>is</em> Google)</li>
</ul>
<p><strong>Cost: </strong>Free! (or $50/user/year if you want to use the <a title="Google Apps" href="http://www.google.com/apps/" target="_blank">business package</a> with 25GB of storage per user)</p>
<h2 style="font-size: 1.5em;">Source-code/Project/Time management</h2>
<p>This is by far my favourite and most valued service that i subscribe to: <strong><a title="CodeBaseHQ" href="http://codebasehq.com" target="_blank">CodeBaseHQ</a>. </strong>Using <strong>CodeBaseHQ </strong>has changed the way that i develop software. It gives me the freedom to work the way i want and feel comfortable knowing that support is just an email away (with super-fast response times and helpful service). Here&#8217;s why I love <strong>CodeBaseHQ</strong>:</p>
<ul>
<li>Great variety of Source-code Management (SCM) repository systems &#8211; Git, Mercurial and (my personal choice) Subversion</li>
<li>Built-in project management features to help me and my clients keep track of bugs &amp; feature requests</li>
<li>Very slick and customizable interface &#8211; easy to understand and use</li>
<li>Secure, well-managed code storage</li>
<li>Very helpful support team</li>
<li>Actively in development &#8211; new features being added all the time</li>
<li>Reasonably priced</li>
<li>Time-tracking built right in</li>
</ul>
<p><strong>Cost: </strong>$8/month for smallest package, $32 for more serious usage</p>
<h2 style="font-size: 1.5em;">Document Managament</h2>
<p>You guessed it&#8230; <strong><a title="Google Docs" href="http://docs.google.com" target="_blank">Google Docs</a>. </strong>Why would you want any other system? Google Docs makes it really easy to view and collaboratively or individually edit documents of most formats. Google Docs allows you to upload files <span style="text-decoration: underline;">of any type</span> and has some crazy features like built-in integration with <a title="Google Translate" href="http://translate.google.com" target="_blank">Google Translate</a> to facilitate translation from right there in your document! Here&#8217;s why i love <strong>Google Docs</strong>:</p>
<ul>
<li>Upload files of any type</li>
<li>View most document formats (PNG, JPG, GIF, PDF, DOC, XLS, PPT)</li>
<li>Collaboratively edit documents (but you can edit on your own if you like <img src='http://ria-coder.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</li>
<li>Built-in dictionary and translation</li>
<li>Creation of a wide variety of document types (text documents, spreadsheets, presentations, forms, drawings)</li>
<li>1GB of storage (or 20GB for a minuscule $5 per year)</li>
</ul>
<p><strong>Cost: </strong>Free! (or $50/user/year if you want to use the <a title="Google Apps" href="http://www.google.com/apps/" target="_blank">business package</a>)</p>
<h2 style="font-size: 1.5em;">Meeting Management</h2>
<p>I know i&#8217;m starting to sound like a Google fanboy, but <strong><a title="Calendar" href="http://calendar.google.com" target="_blank">Google Calendar</a> </strong>is the shit (pardon my French). Apart from doing just what you want a calendar to do (and no less, but a little extra), it&#8217;s really well thought-out and easy to use. Once again, Google has outdone themselves and allowed you to sync your calendar to a wide variety of applications, and i use my calendar on my HTC Hero (a Google phone, wow &#8211; maybe i am a fanboy) to manage all my meetings knowing that all my appointments are safely stored online and accessible anytime. Here&#8217;s why i love <strong>Google Calendar:</strong></p>
<ul>
<li>Clear, concise interface &#8211; very sleek and simple to use</li>
<li>Sensible interface for creating/edit appointments &#8211; drop and drop, expand and contract</li>
<li>Multiple calendars (personal, work, etc)</li>
<li>Integration with your country&#8217;s national holidays (and religious holidays too)</li>
<li>Task management built in</li>
<li>Collaboratively invite people to an event or appointment and keep track of who&#8217;s attending or not</li>
<li>Sync with many clients: Google Chrome, Thunderbird, Outlook, Entourage, iPhone, Android</li>
<li>Extremely fast search &#8211; <em>duh</em></li>
<li>Free notifications &#8211; email, pop-up reminder, <strong>SMS (also free)!!</strong></li>
</ul>
<p><strong>Cost: </strong>Free! (or $50/user/year if you want to use the <a title="Google Apps" href="http://www.google.com/apps/" target="_blank">business package</a>)</p>
<h2 style="font-size: 1.5em;">Billing &amp; Accounting</h2>
<p><strong><a href="http://freshbooks.com">Freshbooks</a>, </strong>what a service! Freshbooks is fantastic online service which allows you to create customizable estimates and invoices &#8211; all accessible via the web. It&#8217;s a very clear and simple application which makes invoicing and cost-estimating really simple, and it makes you look very professional. With over 1 000 000 subscribers to their service, you can be assured that this service is top-notch. Here&#8217;s why i love <strong>Freshbooks:</strong></p>
<ul>
<li>Create your invoices online</li>
<li>Simple, sleek and professional interface that you and your clients can easily understand</li>
<li>Fast, reliable and well supported by a fantastic support team</li>
<li>Actively developed &#8211; new features added often</li>
<li>Manage recurring and once-off payments</li>
<li>Multiple currencies</li>
<li>Built-in accounting</li>
<li>Reasonably priced</li>
</ul>
<p><strong>Cost: </strong>$19 / month (more options <a title="Freshbooks" href="https://secure.freshbooks.com/pricing.php" target="_blank">available</a>)</p>
<h2 style="font-size: 1.5em;">Internal &amp; external communication (Instant messaging, VOIP)</h2>
<p>If you don&#8217;t use <strong><a title="Skype" href="http://www.skype.com/" target="_blank">Skype</a></strong>, then welcome to planet Earth. Skype is a brilliant way to connect to your team and friends. Skype allows you to do instant messaging, voice-calls (free for Skype-to-Skype) and video-calls (Skype-to-Skype). I&#8217;ve been using Skype for years now and i couldn&#8217;t live without it. Skype has some great options available for business usage, and i suggest you <a title="Skype Business" href="http://www.skype.com/intl/en/business/" target="_blank">check them out</a>. Here&#8217;s why i love <strong>Skype</strong>:</p>
<ul>
<li>Ubiquitous &#8211; a good majority of businesses use Skype which means that you can save a lot of money by calling Skype-to-Skype</li>
<li>Simple, clear interface</li>
<li>Extensible</li>
<li>Cost-effectively structure your business telecommunications</li>
</ul>
<p>Cost: Free! (with business options &amp; Skype-to-phoneline credits available)</p>
<h2 style="font-size: 1.5em;">Website Hosting</h2>
<p>When it comes to web-hosting, my personal choice is <strong><a title="VPS.NET" href="http://vps.net" target="_blank">VPS.NET</a></strong>. VPS.NET is a wonderful service offering that allows you to create a <strong>V</strong>irtual <strong>P</strong>rivate <strong>S</strong>erver in one of VPS.NET&#8217;s many datacentres in the UK &amp; US, and do with it what you like! When you sign up with VPS.NET, you purchase a number of &#8220;nodes&#8221; to use; each &#8220;node&#8221; consists of <strong>0.4 GHz processing power, 376Mb of RAM, 10Gb storage and 250Gb bandwidth</strong>. As you buy more and more nodes they become cheaper, and you can tack on extra IP addresses, server monitoring software and automated backups. You can use your VPS to host websites, act as an online storage location, whatever you like! Here&#8217;s why i love <strong>VPS.NET:</strong></p>
<ul>
<li>Simple, sleek user interface</li>
<li>Very competitive service offering and pricing</li>
<li>Excellent and knowledgeable support staff available 24hrs/day</li>
<li>Actively developed &#8211; new features added all the time</li>
<li>Wide variety of operating systems to choose from to install on your VPS</li>
<li>Wide variety of additional services and features</li>
<li>Reliable</li>
</ul>
<p>Cost: <strong>$20 / node</strong> / <strong>month </strong>(with decreasing price as you buy more nodes)</p>
<h1>Summary</h1>
<p>As i&#8217;ve demonstrated, the tools are readily available to manage your development business effectively while sitting on your rump. The service offerings out there completely enthrall me and i&#8217;m delighted to have such a range of efficient tools at my disposal for a minimal cost per month.</p>
<p>Have i missed anything? Got a better solution? Pop me a comment <img src='http://ria-coder.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/managing-your-development-business-for-less-than-50-dollars-per-month/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>WireframeSketcher Review</title>
		<link>http://ria-coder.com/blog/wireframesketcher-review</link>
		<comments>http://ria-coder.com/blog/wireframesketcher-review#comments</comments>
		<pubDate>Sun, 18 Apr 2010 13:31:01 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=587</guid>
		<description><![CDATA[I've been waiting for an Eclipse-based wireframing/mockup tool for a while now, and it's finally here :)]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been waiting for an Eclipse-based wireframing/mockup tool for a while now, and it&#8217;s finally here <img src='http://ria-coder.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  and at $75, i think it&#8217;s a reasonable price to pay for such a useful plugin, although still a little highly priced.</p>
<p><a title="WireframeSketcher" href="http://wireframesketcher.com/" target="_blank">WireframeSketcher </a>is an Eclipse plugin which offers a similar feature-set to <a title="Balsamiq Mockups" href="http://www.balsamiq.com/" target="_blank">Balsamiq Mockups</a>, although personally i prefer WireframeSketcher. Firstly, it plugs right in to my current workflow in Eclipse &#8211; that already wins it many points in my book! Aside from that, the plugin feels a lot more stable than Balsamiq and offers a few interesting features, such as:</p>
<ul>
<li>Wiki syntax formatting on all supported controls</li>
<li>Screens vs Masters vs Storyboards
<ul>
<li>A <strong>Screen </strong>is a view that you can build</li>
<li>A <strong>Master</strong> is a reusable component that can be used in <strong>Screens</strong></li>
<li>A <strong>Storyboard</strong> is made up of a collection of <strong>Screens</strong></li>
</ul>
</li>
<li>Well thought-out presentation mode allowing you to jump between screens</li>
</ul>
<p>All in all, i like the way it&#8217;s structured; i like that you can create separate files for logically separate areas of your whole application mockup and bring them together in a storyboard. I&#8217;ve used it on a couple practical examples that i was planning to do, and it feels comfortable and usable.</p>
<p>If you&#8217;re developing your a Java application with SWT, there&#8217;s also a neat plugin to export your wireframes as SWT code <img src='http://ria-coder.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Maybe an MXML export feature is on the cards too! That would certainly be wonderful&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/wireframesketcher-review/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing Aerial CMS</title>
		<link>http://ria-coder.com/blog/introducing-aerial-cms</link>
		<comments>http://ria-coder.com/blog/introducing-aerial-cms#comments</comments>
		<pubDate>Sun, 11 Apr 2010 20:09:10 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Aerial CMS]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=580</guid>
		<description><![CDATA[Introduction to my latest open-source project - Aerial CMS]]></description>
			<content:encoded><![CDATA[<p>Well, I finally let my irritation get to me&#8230; I&#8217;ve been developing Flash, Flex &amp; AIR applications for two years now &#8211; most of them pulling data through AMFPHP from a PHP-based back-end. In those two years, I&#8217;ve tried nearly all the suggested solutions for managing content on the back-end and pulling it through to the front-end; <a title="Drupal" href="http://drupal.org" target="_blank">Drupal</a>, <a title="MODx" href="http://modx-cms.com" target="_blank">MODx</a>, <a title="WordPress" href="http://wordpress.org" target="_blank">WordPress</a>, <a title="Symfony" href="http://symfony-project.org" target="_blank">Symfony</a>. They are all fantastic PHP-based frameworks and systems, but they don&#8217;t allow me to develop applications the way <em>I want to</em>. So, as a consequence of this combination of irritation, frustration, egotism and flat-out boredom with writing the same code, over and over, for each project, I&#8217;ve decided to build a CMS &#8211; <strong>Aerial CMS</strong>.</p>
<p><img class="aligncenter size-full wp-image-583" title="aerial-logo" src="http://ria-coder.com/temp/wp-content/uploads/2010/04/aerial-logo.png" alt="aerial-logo" width="280" height="70" /></p>
<h2>What is Aerial CMS?</h2>
<p>Aerial CMS (named Aerial because it was the first word i could think of with <em>&#8220;RIA&#8221;</em> in it) is a <span style="text-decoration: underline;">simple content management framework</span>. I decided to rethink the concept of a content management system, because &#8211; the way I see it &#8211; CMSs these days are about content management <strong>AND</strong> content presentation. I think that these two massive areas of development &amp; design need to stay very far away from each other. They are like brother and sister to us now, but sometimes &#8211; when stuck in a room together for so long &#8211; they breed and the results are disastrous (on top of being scandalous!).</p>
<h2>Design Philosophy</h2>
<p>Look at how the MVC (<strong>M</strong>odel <strong>V</strong>iew <strong>C</strong>ontroller) pattern came about: software engineers found that <em>separating application logic from presentation from data</em> has serious design benefits. Now, i&#8217;m not attempting to bad-mouth all the incredible efforts of the CMS developers&#8230; I&#8217;m saying that for <em>Rich Internet Application</em> development, it really becomes a chore to use systems like Drupal or Symfony because they were not meant to be used in that way. They do what they do superbly well, but for RIAs they fail to impress me.</p>
<p>Aerial CMS has been built from the first line of code for <em>optimized Rich Internet Application</em> development. It focuses only on content management and development tooling, and wants <strong>nothing to do with how you present the data</strong>. It&#8217;s certainly a change from the standard model, and i&#8217;m convinced about how I want to develop my RIAs, but that&#8217;s why i&#8217;ve put out this early release &#8211; to see if you all agree with me. This CMS still has a very, very long way to go; it works well for most situations but the tools haven&#8217;t been developed yet.</p>
<h2>Technology</h2>
<p>Aerial has been built on two very well established and loved open-source frameworks, namely <strong><a title="AMFPHP" href="sourceforge.net/projects/amfphp" target="_blank">AMFPHP</a></strong> 1.9 and <strong><a title="Doctrine" href="http://doctrine-project.org" target="_blank">Doctrine</a> </strong>1.2.1. The Aerial framework is built for compatibility with <strong>PHP 5 only</strong>. Aerial enforces no rules upon you when you get down to developing your back-end code, but it does stick to Doctrine&#8217;s method of generating database tables and models. In essence, once you&#8217;ve set up your database schema, you can do whatever you like <img src='http://ria-coder.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  you can plug into Doctrine&#8217;s API or you can write your own code; it really gives you the freedom to code the way you&#8217;re comfortable with.</p>
<h2>Tutorials and Videos</h2>
<p>I&#8217;ve made a <a title="Getting Started" href="http://aerial-project.org/videos/getting-started/" target="_blank">Getting Started</a> video to get you familiar with the framework and i&#8217;ll be writing a series of tutorials in the <a title="Wiki" href="http://code.google.com/p/aerial-cms/w/list" target="_blank">Wiki section</a> of the <a title="Google Code page" href="http://code.google.com/p/aerial-cms/" target="_blank">Google Code page</a> for Aerial CMS. I&#8217;ve also got plans for a couple more video tutorials, so keep checking the site for updates or follow me on Twitter (<strong><a title="Twitter" href="http://twitter.com/dannykopping" target="_blank">@dannykopping</a></strong>).</p>
<h2>Comments, Suggestions, et al</h2>
<p>I&#8217;d love to hear what you have to say (as long as it&#8217;s in English &#8211; being monolingual sucks)! I&#8217;m very open to suggestions, any offers to help contribute would be welcomed and all constructive criticism is encouraged!</p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/introducing-aerial-cms/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Dynamically controlling cross-domain permissions</title>
		<link>http://ria-coder.com/blog/dynamically-controlling-cross-domain-permissions</link>
		<comments>http://ria-coder.com/blog/dynamically-controlling-cross-domain-permissions#comments</comments>
		<pubDate>Tue, 09 Mar 2010 23:12:46 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=566</guid>
		<description><![CDATA[What are crossdomain.xml files? As any developer who has ever dipped their toes into the murky pond that is cross-domain configuration with Flash will tell you, it is quite a confusing and somewhat aggravating task to accomplish. In this post, I&#8217;m going to demonstrate how you can control access to your APIs from Flash applications]]></description>
			<content:encoded><![CDATA[<h2>What are crossdomain.xml files?</h2>
<p>As any developer who has ever dipped their toes into the murky pond that is cross-domain configuration with Flash will tell you, it is quite a confusing and somewhat aggravating task to accomplish. In this post, I&#8217;m going to demonstrate how you can control access to your APIs from Flash applications by dynamically generating crossdomain.xml files that work the same as static crossdomain.xml files.</p>
<p>But before we go any further, what the hell is a crossdomain.xml file?</p>
<p>The definition of a cross-domain configuration file is (taken from <a title="Cross-Domain" href="http://www.senocular.com/pub/adobe/crossdomain/policyfiles.html" target="_self">http://www.senocular.com/pub/adobe/crossdomain/policyfiles.html</a>):</p>
<blockquote><p>A cross-domain policy file is a XML document that grants a web client, such as Adobe Flash Player, permission to handle data across multiple domains. When a client hosts a content from a particular source domain and that content makes requests directed towards a domain other than its own, the remote domain would need to host a cross-domain policy file that would grant access to the source domain allowing the client to continue with the transaction. Policy files grant read access to data as well as permit a client to include custom headers in cross-domain requests.</p></blockquote>
<p>Essentially what this means is that if you have a Flash application and you need to pull data (other than images or video) from a domain which is not the domain of your hosted application, you will need to place a crossdomain.xml file on the server you are requesting data from.</p>
<p>The configuration file needs to be placed in the webroot of the server; you can have a look at some of the more popular sites&#8217; crossdomain.xml files:</p>
<ul>
<li><a title="YouTube" href="http://youtube.com/crossdomain.xml" target="_blank">http://youtube.com/crossdomain.xml</a></li>
<li><a title="Twitter" href="http://twitter.com/crossdomain.xml" target="_blank">http://twitter.com/crossdomain.xml</a></li>
<li><a title="Facebook" href="http://facebook.com/crossdomain.xml" target="_blank">http://facebook.com/crossdomain.xml</a></li>
</ul>
<p>This post is not a &#8220;how-to&#8221; on crossdomain.xml files unfortunately: for that, you can visit <a title="Crossdomain Help" href="http://www.adobe.com/devnet/flashplayer/articles/cross_domain_policy.html" target="_blank">http://www.adobe.com/devnet/flashplayer/articles/cross_domain_policy.html</a> &#8211; a great article by Lucas Adamski.</p>
<h2>The Problem</h2>
<p>You would like to control access to your application&#8217;s API based on a database table, for instance:</p>
<p>You have an application that serves up a list of products like Amazon.com to be made available via AMF requests (could be a REST-based architecture, SOAP, etc). You have a service offering whereby Flash/Flex application developers can register with your company to be allowed to access this wonderful API. You charge a set price per year for your service and you keep a database of authorized subscribers. At this stage, you can either allow any domain to access your API by using the following crossdomain.xml file:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE cross-domain-policy SYSTEM &quot;http://www.adobe.com/xml/dtds/cross-domain-policy.dtd&quot;&gt;</span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cross-domain-policy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;site-control</span> <span style="color: #000066;">permitted-cross-domain-policies</span>=<span style="color: #ff0000;">&quot;master-only&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;allow-access-from</span> <span style="color: #000066;">domain</span>=<span style="color: #ff0000;">&quot;*&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/cross-domain-policy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>The problem with this configuration is that any domain can send requests to your API from their Flash applications, and for obvious reasons this is not such a great idea.</p>
<p>The other (more secure) option would be to manually stick in each subscriber&#8217;s domain name into the crossdomain.xml file as follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE cross-domain-policy SYSTEM &quot;http://www.adobe.com/xml/dtds/cross-domain-policy.dtd&quot;&gt;</span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cross-domain-policy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;site-control</span> <span style="color: #000066;">permitted-cross-domain-policies</span>=<span style="color: #ff0000;">&quot;master-only&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;allow-access-from</span> <span style="color: #000066;">domain</span>=<span style="color: #ff0000;">&quot;example1.com&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;allow-access-from</span> <span style="color: #000066;">domain</span>=<span style="color: #ff0000;">&quot;example2.com&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;allow-access-from</span> <span style="color: #000066;">domain</span>=<span style="color: #ff0000;">&quot;example3.com&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/cross-domain-policy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>With the above configuration, you will start running into major headaches your subscribers either start cancelling their accounts or fail to pay in full. You will manually have to go and remove their domains from the configuration each time.</p>
<h2>The Solution</h2>
<p>When Flash applies a security policy like this, it automatically looks for a crossdomain.xml file on the requested server in the webroot. We can use a nifty combination of Apache rewriting and a PHP script to dynamically generate a list of authorized domains.</p>
<h3>Apache Configuration</h3>
<p>We want Apache to listen for an incoming request for our crossdomain.xml file, but instead of serving the XML file, we want to process a PHP script called <strong>generate-config.php</strong> to generate our configuration options. This example is quite simplistic, and I encourage you to take this further with whatever rules your application may require.</p>
<p>We are going to create a <strong>.htaccess</strong> file in the webroot of our server with the following contents:</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 193px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">RewriteEngine On</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 193px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">RewriteCond %{REQUEST_URI} crossdomain.xml</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 193px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">RewriteRule ^crossdomain\.xml$ generate-config.php [L]</div>
<pre>RewriteEngine On
RewriteCond %{REQUEST_URI} crossdomain.xml
RewriteRule ^crossdomain\.xml$ generate-config.php [L]</pre>
<p>This will present the output of our <strong>generate-config.php</strong> file as the contents of the <strong>crossdomain.xml</strong> file &#8211; essentially using another file&#8217;s content in place of another.</p>
<h3>PHP &amp; MySQL</h3>
<p>In our <strong>generate-config.php</strong> file, we are going to:</p>
<ol>
<li>Connect to a database</li>
<li>Run a SQL query that will return a list of subscribers</li>
<li>Iterate through our list and add them to our XML output</li>
<li>Echo the XML output back to Apache</li>
</ol>
<p>First, create a database called <strong>crossdomain_test</strong> and then run the following SQL query to create our <em>subscribers</em> table:</p>
<pre>CREATE TABLE IF NOT EXISTS `subscribers` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `domain` varchar(255) NOT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;</pre>
<p>Insert a couple of test rows:</p>
<pre>INSERT INTO `subscribers` (`ID`, `name`, `domain`, `active`) VALUES
(1, 'YouTube', 'youtube.com', 1),
(2, 'Twitter', 'twitter.com', 1);</pre>
<p>Now we&#8217;re going to create our <strong>generate-config.php</strong> file in the webroot:</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
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #666666; font-style: italic;">// create our config skeleton according to the crossdomain.xml rules</span>
	<span style="color: #000088;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;!DOCTYPE cross-domain-policy SYSTEM &quot;http://www.adobe.com/xml/dtds/cross-domain-policy.dtd&quot;&gt;
&lt;cross-domain-policy&gt;
	&lt;site-control permitted-cross-domain-policies=&quot;master-only&quot;/&gt;
&lt;/cross-domain-policy&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// create $config variable to hold our config data</span>
	<span style="color: #000088;">$config</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SimpleXMLElement<span style="color: #009900;">&#40;</span><span style="color: #000088;">$xml</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// connect to MySQL and select database</span>
	<span style="color: #000088;">$conn</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;localhost&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;username&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;password&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;crossdomain_test&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$conn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// loop through all rows, and create xml nodes</span>
	<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT domain FROM subscribers WHERE active = 1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$subscriber</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$res</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$child</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$config</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addChild</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;allow-access-from&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$child</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;domain&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subscriber</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">domain</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// echo back to Apache</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$config</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">asXML</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>If we navigate to the <strong>crossdomain.xml</strong> file in the browser, we should see:</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="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE cross-domain-policy SYSTEM &quot;http://www.adobe.com/xml/dtds/cross-domain-policy.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cross-domain-policy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;site-control</span> <span style="color: #000066;">permitted-cross-domain-policies</span>=<span style="color: #ff0000;">&quot;master-only&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;allow-access-from</span> <span style="color: #000066;">domain</span>=<span style="color: #ff0000;">&quot;youtube.com&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;allow-access-from</span> <span style="color: #000066;">domain</span>=<span style="color: #ff0000;">&quot;twitter.com&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/cross-domain-policy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>and if we delete one of the records out of the table (try deleting YouTube), and navigate to that page again, you&#8217;ll see:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE cross-domain-policy SYSTEM &quot;http://www.adobe.com/xml/dtds/cross-domain-policy.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cross-domain-policy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;site-control</span> <span style="color: #000066;">permitted-cross-domain-policies</span>=<span style="color: #ff0000;">&quot;master-only&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;allow-access-from</span> <span style="color: #000066;">domain</span>=<span style="color: #ff0000;">&quot;twitter.com&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/cross-domain-policy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>And that&#8217;s it! Not too difficult at all <img src='http://ria-coder.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>A Workaround for all frustrated developers consuming REST services</h2>
<p>As a side-note, if you ever encounter a site that you need to pull data from and they do not have a crossdomain.xml file, all you have to do is write a simple &#8220;proxy&#8221; file with PHP (or whichever language you choose) that will accept one parameter (the URL to be called) and send the results back:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
	<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;url&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Make sure that this proxy file is sitting in your domain though, or a domain with a crossdomain.xml file present.</p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/dynamically-controlling-cross-domain-permissions/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Balsamiq Mockups &#8211; An essential tool for developers and designers</title>
		<link>http://ria-coder.com/blog/balsamiq-mockups-an-essential-tool-for-developers-and-designers</link>
		<comments>http://ria-coder.com/blog/balsamiq-mockups-an-essential-tool-for-developers-and-designers#comments</comments>
		<pubDate>Tue, 02 Mar 2010 23:24:44 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=558</guid>
		<description><![CDATA[At the risk of sounding like a shameless peddler of commercial software, I would seriously recommend Balsamiq Mockups. Now, let my intentions be clear&#8230; I made an agreement with Valerie from Balsamiq that I would write a review of this software on my blog in exchange for a testing license. Look, what can I say&#8230;]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.balsamiq.com/"><img class="alignleft" style="margin: 5px;" title="Balsamiq Logo" src="http://www.balsamiq.com/images/balsamiq_logo.png" alt="" width="524" height="163" /></a>At the risk of sounding like a shameless peddler of commercial software, I would <strong>seriously</strong> recommend <a title="Balsamiq Mockups" href="http://www.balsamiq.com/products/mockups/desktop" target="_blank">Balsamiq Mockups</a>. Now, let my intentions be clear&#8230; I made an agreement with Valerie from <a title="Balsamiq Mockups" href="http://www.balsamiq.com/products/mockups/desktop" target="_blank">Balsamiq</a> that I would write a review of this software on my blog in exchange for a testing license. Look, what can I say&#8230; I was born Jewish.</p>
<p>Now, just because I received a free license to review the software it does not mean that will not point out the egregious problems that I find with the software, nor will I ramble on about how fantastic it is. All I will say is this: <strong>If you deal with clients often that have not got any creative done for a prospective project and are looking for Interface Design advice, this is the tool for you!</strong></p>
<p>Onto the review&#8230;</p>
<h3>Overview</h3>
<p><a title="Balsamiq Mockups" href="http://www.balsamiq.com/products/mockups/desktop" target="_blank">Balsamiq Mockups</a> is an AIR application built to help you mock up application interface designs in the timeframe of a (non-metric) &#8220;jiffy&#8221;. Since i&#8217;ve started using the application, i&#8217;ve put together numerous mockups for clients and always received good feedback. What <a title="Balsamiq Mockups" href="http://www.balsamiq.com/products/mockups/desktop" target="_blank">Balsamiq</a> lacks in extensibility it makes up for in sheer speed of use.<br />
The application is well thought out and concise. No instruction manual or cerebral documentation necessary! As far as AIR applications go, this is one of the more advanced ones I&#8217;ve seen, and it certainly is a pleasure to work with. I wouldn&#8217;t go so far as to say it justifies a $79 price-tag, but it is well worth the loot.</p>
<h3>Tooling and Extensibility</h3>
<p>As far as tools go, the <a title="Balsamiq Mockups" href="http://www.balsamiq.com/products/mockups/desktop" target="_blank">Balsamiq</a> developers certainly went out of their way. Included in the application are over 75 user-interface components from <strong>Buttons</strong> to <strong>Charts</strong> to <strong>iPhones, </strong>as well as loads of icons that will provide the finishing touches on any rough cut. The components are all customizable, scalable and z-axis-orderable, and the keyboard shortcuts help you get the job done quite quickly once you&#8217;re comfortable with the application.</p>
<p>The application fails abysmally when it comes to extensibility; I would imagine that with an application like this, the developers should facilitate the downloading of custom component/icon packs, or even user-submitted ones. This could as quite an interesting angle to the application i feel. Another thing I wish it included was some sort of color palette to slightly adjust the components. I&#8217;m assuming that it wouldn&#8217;t be too much trouble to include a little color-transform slider to add a bit more dimension to the components for added visual cues.</p>
<p>Good thing i downloaded the latest version (1.6.67 released on 24th Feb 2010) before i started ranting about the absence of the spacebar-invoked panning functionality&#8230; Good job guys! Works great <img src='http://ria-coder.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Search, Export and Memory Usage</h3>
<p>The search functionality of <a title="Balsamiq Mockups" href="http://www.balsamiq.com/products/mockups/desktop" target="_blank">Balsamiq</a> is intuitive and responsive; scanning through different UI elements is a breeze and makes the whole experience that much more impressive. <a title="Balsamiq Mockups" href="http://www.balsamiq.com/products/mockups/desktop" target="_blank">Balsamiq</a> offers exporting your mockups to both PNG (why not JPG?) and PDF (go Thibault!) and it usually exports the mockups without problems. I&#8217;ve noticed that when my mockups become quite intense, the application does begin to lag a little though, but i&#8217;m confident that the developers are looking into that for future releases.</p>
<h3>Conclusion</h3>
<p>All in all, this is an indispensable tool for the discerning web developer &amp; designer. If you need to give your clients an idea of what you&#8217;re going to produce and you have limited time, give this application a shot. Thanks to the <a title="Balsamiq Mockups" href="http://www.balsamiq.com/products/mockups/desktop" target="_blank">Balsamiq</a> team for the great addition to my development ammunition!</p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/balsamiq-mockups-an-essential-tool-for-developers-and-designers/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing services-config.xml values from Flex at runtime</title>
		<link>http://ria-coder.com/blog/accessing-services-config-values-with-flex</link>
		<comments>http://ria-coder.com/blog/accessing-services-config-values-with-flex#comments</comments>
		<pubDate>Thu, 11 Feb 2010 19:24:58 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[serverconfig]]></category>
		<category><![CDATA[services-config]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=545</guid>
		<description><![CDATA[Recently I found this magic class in the Flex 3 SDK called ServerConfig.]]></description>
			<content:encoded><![CDATA[<p>Recently I found this magic class in the Flex 3 SDK called <a title="ServerConfig" href="http://www.adobe.com/livedocs/flex/3/langref/mx/messaging/config/ServerConfig.html" target="_blank">ServerConfig</a>. This class is great&#8230; What it allows you to do is access values that you defined in your <em>services-config.xml</em> file used to define the communication channels between Flex and your server.</p>
<p>Take the following <em>services-config.xml</em> file for example:</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
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;services-config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;services<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;amfphp-flashremoting-service&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;flex.messaging.services.RemotingService&quot;</span></span>
<span style="color: #009900;">				<span style="color: #000066;">messageTypes</span>=<span style="color: #ff0000;">&quot;flex.messaging.messages.RemotingMessage&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;destination</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;amfphp&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;channels<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;channel</span> <span style="color: #000066;">ref</span>=<span style="color: #ff0000;">&quot;my-amfphp&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/channels<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>*<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/destination<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/services<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;channels<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;channel-definition</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;my-amfphp&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;mx.messaging.channels.AMFChannel&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;endpoint</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;gateway.php&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;flex.messaging.endpoints.AMFEndpoint&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/channel-definition<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/channels<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/services-config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>As you can see, we&#8217;re setting the endpoint for our <em>my-amfphp</em> channel to <strong>gateway.php</strong>. What if you wanted to read that value into your Flex application? You could use the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>ServerConfig.getChannel<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;my-amfphp&quot;</span><span style="color: #000000;">&#41;</span>.endpoint<span style="color: #000000;">&#41;</span>;</pre></div></div>

<p>Check out the <a title="ServerConfig" href="http://www.adobe.com/livedocs/flex/3/langref/mx/messaging/config/ServerConfig.html" target="_blank">ServerConfig</a> for more information!</p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/accessing-services-config-values-with-flex/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>AMFPHP is back!</title>
		<link>http://ria-coder.com/blog/amfphp-is-back</link>
		<comments>http://ria-coder.com/blog/amfphp-is-back#comments</comments>
		<pubDate>Tue, 02 Feb 2010 13:29:49 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[amfphp]]></category>
		<category><![CDATA[amfphp 1.9]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=541</guid>
		<description><![CDATA[AMFPHP is back!]]></description>
			<content:encoded><![CDATA[<p>Today is a wonderful day!</p>
<p>I have teamed up with <a title="Ariel Sommeria" href="http://arielsommeria.com/blog/" target="_blank">Ariel Sommeria-klein</a> to revive the legendary <a title="AMFPHP" href="http://amfphp.sourceforge.net" target="_blank">AMFPHP</a> project that spawned a whole new dimension of Rich Internet Applications. Together we have brought <a title="AMFPHP 1.9" href="https://sourceforge.net/projects/amfphp/files/#files" target="_blank">AMFPHP 1.9</a> out of beta and made it compatible with PHP 5.3. We have also completely rewritten the AMFPHP service browser and we have several improvements planned for AMFPHP 2.0.</p>
<p>If you would like to help contribute to this great open-source application, please <a title="Contact Us!" href="http://amfphp.sourceforge.net/contact.html" target="_blank">contact us</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/amfphp-is-back/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Truly Cached Flex Modules</title>
		<link>http://ria-coder.com/blog/truly-cached-flex-modules</link>
		<comments>http://ria-coder.com/blog/truly-cached-flex-modules#comments</comments>
		<pubDate>Sun, 31 Jan 2010 19:56:14 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[modules]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=532</guid>
		<description><![CDATA[I was working on a project recently and I discovered (or possibly misunderstood - see disclaimer) that Flex does not cache modules correctly, or - at the very least - it does not do it effectively according to my tests.]]></description>
			<content:encoded><![CDATA[<p>I was working on a project recently and I discovered (or possibly misunderstood &#8211; see disclaimer) that Flex does <strong>not</strong> cache modules correctly, or &#8211; at the very least &#8211; it does not do it effectively according to my tests.</p>
<p><em>My test was conducted using Flex SDK <strong>3.4.0.9271, </strong>Firefox <strong>3.5.7 </strong>and <strong>Flex Builder Professional 3.0.214193</strong></em></p>
<p>According to <a title="Adobe LiveDocs" href="http://livedocs.adobe.com/flex/3/html/help.html?content=modular_5.html" target="_blank">this</a> page (under the <strong>Preloading modules</strong> heading), Adobe asserts the following:</p>
<blockquote><p>When a module is loaded by the Flex application for the first time, the module&#8217;s SWF file is transferred across the network and stored in the browser&#8217;s cache. If the Flex application unloads that module, but then later reloads it, there should be less wait time because Flash Player loads the module from the cache rather than across the network.</p>
<p>Module SWF files, like all SWF files, reside in the browser&#8217;s cache unless and until a user clears them. As a result, modules can be loaded by the main application across several sessions, reducing load time; but this depends on how frequently the browser&#8217;s cache is flushed.</p></blockquote>
<p>I found the above claims to be demonstrably false, or at least just plain inefficient&#8230;</p>
<p>Let me qualify this:<br />
According to my tests (conducted with my Firefox browser cache turned both on and off), i found that the application&#8217;s memory usage keeps growing exponentially when switching between two loaded modules. There was a variance (as you&#8217;d imagine) when the browser cache was left on but nonetheless, the memory usage keeps growing steadily.</p>
<p>In the code sample below, I have extended the functionality of the <strong>mx.modules.ModuleLoader</strong> class, and added a Dictionary (with a little logic) to manage the (ostensibly) effective caching of previously loaded modules. I have not tested this class extensively, but all the tests that I conducted seemed to produce a significant memory and speed improvement.</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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">DisplayObject</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">DisplayObjectContainer</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span>.<span style="color: #004993;">ByteArray</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span>.<span style="color: #004993;">Dictionary</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> mx.events.FlexEvent;
	<span style="color: #0033ff; font-weight: bold;">import</span> mx.events.ModuleEvent;
	<span style="color: #0033ff; font-weight: bold;">import</span> mx.modules.IModuleInfo;
	<span style="color: #0033ff; font-weight: bold;">import</span> mx.modules.ModuleLoader;
	<span style="color: #0033ff; font-weight: bold;">import</span> mx.modules.ModuleManager;
&nbsp;
	<span style="color: #3f5fbf;">/**
	 * This class manages the loading, unloading and caching of Flex Modules
	 * This is a modified version of the mx.modules.ModuleLoader class
	 *
	 * @author Danny Kopping - danny@ria-coder.com
	 */</span>
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> CachedModuleLoader extends ModuleLoader
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">map</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Dictionary</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Dictionary</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _url<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #0033ff; font-weight: bold;">null</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> module<span style="color: #000000; font-weight: bold;">:</span>IModuleInfo;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> loadRequested<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">false</span>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> CachedModuleLoader<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> <span style="color: #004993;">url</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span> == _url<span style="color: #000000;">&#41;</span>
				<span style="color: #0033ff; font-weight: bold;">return</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>module<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				module.<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent.<span style="color: #004993;">PROGRESS</span>, moduleProgressHandler<span style="color: #000000;">&#41;</span>;
				module.<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent.SETUP, moduleSetupHandler<span style="color: #000000;">&#41;</span>;
				module.<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent.READY, moduleReadyHandler<span style="color: #000000;">&#41;</span>;
				module.<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent.<span style="color: #004993;">ERROR</span>, moduleErrorHandler<span style="color: #000000;">&#41;</span>;
				module.<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent.<span style="color: #004993;">UNLOAD</span>, moduleUnloadHandler<span style="color: #000000;">&#41;</span>;
&nbsp;
				<span style="color: #009900;">//module.release();</span>
				module = <span style="color: #0033ff; font-weight: bold;">null</span>;
&nbsp;
				<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">child</span><span style="color: #000000;">&#41;</span>
				<span style="color: #000000;">&#123;</span>
					<span style="color: #004993;">removeChild</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">child</span><span style="color: #000000;">&#41;</span>;
					<span style="color: #009900;">//child = null;</span>
				<span style="color: #000000;">&#125;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			_url = <span style="color: #004993;">value</span>;
&nbsp;
			<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> FlexEvent<span style="color: #000000;">&#40;</span>FlexEvent.URL_CHANGED<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
			removeAllChildren<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>_url <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #0033ff; font-weight: bold;">null</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> loadRequested<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">!</span><span style="color: #004993;">map</span><span style="color: #000000;">&#91;</span>_url<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>
					loadModule<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
				<span style="color: #0033ff; font-weight: bold;">else</span>
				<span style="color: #000000;">&#123;</span>
&nbsp;
					<span style="color: #004993;">child</span> = <span style="color: #004993;">map</span><span style="color: #000000;">&#91;</span>_url<span style="color: #000000;">&#93;</span>;
					<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">child</span><span style="color: #000000;">&#41;</span>;
				<span style="color: #000000;">&#125;</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> <span style="color: #004993;">url</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> _url;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> createComponentsFromDescriptors<span style="color: #000000;">&#40;</span>recurse<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span>.createComponentsFromDescriptors<span style="color: #000000;">&#40;</span>recurse<span style="color: #000000;">&#41;</span>;
&nbsp;
			loadRequested = <span style="color: #0033ff; font-weight: bold;">true</span>;
			loadModule<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> loadModule<span style="color: #000000;">&#40;</span><span style="color: #004993;">url</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #0033ff; font-weight: bold;">null</span>, bytes<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">ByteArray</span> = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">url</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>
				_url = <span style="color: #004993;">url</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>_url == <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #009900;">//trace(&quot;loadModule() - null url&quot;);</span>
				<span style="color: #0033ff; font-weight: bold;">return</span>;
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">map</span><span style="color: #000000;">&#91;</span>_url<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #009900;">//trace(&quot;loadModule() - already created the child&quot;);</span>
				<span style="color: #0033ff; font-weight: bold;">return</span>;
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>module<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #009900;">//trace(&quot;loadModule() - load already initiated&quot;);</span>
				<span style="color: #0033ff; font-weight: bold;">return</span>;
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> FlexEvent<span style="color: #000000;">&#40;</span>FlexEvent.LOADING<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			module = ModuleManager.getModule<span style="color: #000000;">&#40;</span>_url<span style="color: #000000;">&#41;</span>;
&nbsp;
			module.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent.<span style="color: #004993;">PROGRESS</span>, moduleProgressHandler<span style="color: #000000;">&#41;</span>;
			module.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent.SETUP, moduleSetupHandler<span style="color: #000000;">&#41;</span>;
			module.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent.READY, moduleReadyHandler<span style="color: #000000;">&#41;</span>;
			module.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent.<span style="color: #004993;">ERROR</span>, moduleErrorHandler<span style="color: #000000;">&#41;</span>;
			module.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent.<span style="color: #004993;">UNLOAD</span>, moduleUnloadHandler<span style="color: #000000;">&#41;</span>;
&nbsp;
			module.<span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">applicationDomain</span>, <span style="color: #0033ff; font-weight: bold;">null</span>, bytes<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> unloadModule<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">child</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #004993;">contains</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">child</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #004993;">removeChild</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">child</span><span style="color: #000000;">&#41;</span>;
				<span style="color: #004993;">child</span> = <span style="color: #0033ff; font-weight: bold;">null</span>;
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>module<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				module.<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent.<span style="color: #004993;">PROGRESS</span>, moduleProgressHandler<span style="color: #000000;">&#41;</span>;
				module.<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent.SETUP, moduleSetupHandler<span style="color: #000000;">&#41;</span>;
				module.<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent.READY, moduleReadyHandler<span style="color: #000000;">&#41;</span>;
				module.<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent.<span style="color: #004993;">ERROR</span>, moduleErrorHandler<span style="color: #000000;">&#41;</span>;
&nbsp;
				module.<span style="color: #004993;">unload</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
				module.<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent.<span style="color: #004993;">UNLOAD</span>, moduleUnloadHandler<span style="color: #000000;">&#41;</span>;
				module = <span style="color: #0033ff; font-weight: bold;">null</span>;
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">map</span><span style="color: #000000;">&#91;</span>_url<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">delete</span> <span style="color: #004993;">map</span><span style="color: #000000;">&#91;</span>_url<span style="color: #000000;">&#93;</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> moduleProgressHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span>ModuleEvent<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span>event<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> moduleSetupHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span>ModuleEvent<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #009900;">// Not ready for creation yet, but can call factory.info().</span>
&nbsp;
			<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span>event<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> moduleReadyHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span>ModuleEvent<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">child</span> = module.factory.create<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">DisplayObject</span>;
			<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span>event<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">child</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> p<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">DisplayObjectContainer</span> = <span style="color: #004993;">parent</span>;
				<span style="color: #009900;">// p.removeChild(this);</span>
				<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">child</span><span style="color: #000000;">&#41;</span>;
&nbsp;
				<span style="color: #004993;">map</span><span style="color: #000000;">&#91;</span><span style="color: #004993;">url</span><span style="color: #000000;">&#93;</span> = <span style="color: #004993;">child</span>;<span style="color: #009900;">//ModuleManager.getModule(_url);</span>
				<span style="color: #009900;">//trace(map + &quot;:&quot; + url + &quot;:&quot; + map[url]);</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> moduleErrorHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span>ModuleEvent<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			unloadModule<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span>event<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> moduleUnloadHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span>ModuleEvent<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span>event<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>The usage of this class is exactly the same as the regular <strong>mx.modules.ModuleLoader</strong> class. I hope this helps!</p>
<p><strong>Download this file:</strong> <a href="http://ria-coder.com/blog/wp-content/uploads/2010/01/CachedModuleLoader.as">Download</a></p>
<p><strong>**DISCLAIMER**<br />
<span style="font-weight: normal; ">I know a bit about Flex modules from hours of obsessing over them, but i <span style="text-decoration: underline;">do not know everything</span>. From my tests of the efficacy of the above code &amp; explanation, i found that it reduces memory usage and increases the general usability of my Flex project; i could be very wrong on this topic, and if i am &#8211; please tell me. Maybe i&#8217;m just an idiot, but it seems to work&#8230;</span></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/truly-cached-flex-modules/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>VirtualBox Guest Additions woes</title>
		<link>http://ria-coder.com/blog/virtualbox-guest-additions-woes</link>
		<comments>http://ria-coder.com/blog/virtualbox-guest-additions-woes#comments</comments>
		<pubDate>Mon, 18 Jan 2010 21:41:26 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=529</guid>
		<description><![CDATA[Sigh... I wish that computers would just work all the time!]]></description>
			<content:encoded><![CDATA[<p>Sigh&#8230; I wish that computers would just work all the time!</p>
<p>Today i booted my machine, launched my snazzy Linux virtual machine, proceeded to start my XAMPP stack and mount my shared folder so that my Linux VM can communicate with my host OS (sigh) Windows&#8230; This works 99.9% of the time, but to my horror:</p>
<blockquote><p>/sbin/mount.vboxsf: mounting failed with the error: No such device</p></blockquote>
<p>FUCK! What now? So i <a title="Google 1" href="http://www.google.com/search?rlz=1C1GGLS_enZA330ZA330&amp;sourceid=chrome&amp;ie=UTF-8&amp;q=/sbin/mount.vboxsf:+mounting+failed+with+the+error:+No+such+device" target="_blank">google</a> and <a title="Google 2" href="http://www.google.com/search?hl=en&amp;rlz=1C1GGLS_enZA330ZA330&amp;q=error+loading+vboxguestadditions+linux+vboxsf&amp;aq=f&amp;oq=&amp;aqi=" target="_blank">google</a>, but nothing works&#8230;</p>
<p>I&#8217;m now bashing my head in frustration against my desk, spilling my coffee and rubbing my blood-red forehead, but that didn&#8217;t help either&#8230; I try mount VBoxGuestAdditions via VirtualBox, nothing. Nothing, nothing, nothing! <strong>NOTHING!</strong></p>
<p>By now i&#8217;m getting so irritated that i&#8217;m drinking coffee after coffee and smoking vociferously&#8230; and then&#8230;. -cue lightbulb- if you can&#8217;t take the horse to the water (mount VBoxGuestAdditions in Linux), pick the fucker up and dump him in there (download the fucking thing from Linux and run it from Linux). So, i dig around looking for the URL, eventually find it, mount the ISO file (help instructions on mounting an ISO file in Linux <a title="Mounting an ISO" href="http://www.cyberciti.biz/tips/how-to-mount-iso-image-under-linux.html" target="_blank">here</a>), run the installation script, reboot and <strong>IT WORKS</strong>!! &#8230;and the children lived happily ever after.</p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/virtualbox-guest-additions-woes/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
