<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Pixelbox</title>
	
	<link>http://www.pixelbox.net</link>
	<description>Pixelbox, technology development and photography.</description>
	<lastBuildDate>Thu, 08 Apr 2010 16:35:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Pixelbox" /><feedburner:info uri="pixelbox" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>“Save as iPhone web app” bookmarklet</title>
		<link>http://feedproxy.google.com/~r/Pixelbox/~3/WAB78p-i-3E/</link>
		<comments>http://www.pixelbox.net/2010/04/08/save-as-iphone-web-app-bookmarklet/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 16:13:38 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/?p=423</guid>
		<description><![CDATA[Ever wished website owners would make their mobiles sites save to the iPhone as a web app? Not any more...]]></description>
			<content:encoded><![CDATA[<p>I was chatting to <a href="http://www.lyingonthecovers.net/?p=371">Tom</a> today about the all things iPad/iPhone etc and he mentioned an article on the Guardian where they mentioned being hard pushed to create an iPad app that offered anything over their website.
</p>
<p>
We have often thought this about many apps that litter the app store that could easily have been done in HTML 5. With a target of the iPhone there is a lot of support and it&#8217;s often hard to tell if something is a native app or a web app (<a href="http://mrgan.tumblr.com/post/257187093/pie-guy">pie guy is a great example</a>). In many ways it&#8217;s a better idea to do this, as you can then use the same &#8220;app&#8221; on any device, the BBC mobile news site is a great example, and I&#8217;m unsure what valuable extras they could add by creating a native app&#8230;
</p>
<p>
The problem is, the onus is on the developers to tell the iPhone specific things, that can make such a diference. Some are quite complex and would require lots of work, but others are really simple, such as default zoom, and if the toolbar is required (The BBC mobile site always opens slightly too zoomed in!). These are done by simply adding meta tags to the head of your HTML. We then suddenly realised that you could do this using a JavaScript bookmarklet, <a href="http://www.pixelbox.net/2008/01/17/custom-icons-for-your-iphone-web-clips/">the same way Drew did way back for changing the home screen icon</a>.
</p>
<p>
Obviously we quickly created one and it works a treat. Basically you click the bookmarklet on a site of your choice, and when it loads it won&#8217;t open in normal Safari and won&#8217;t show you an address bar. This is great for apps like Gmail, Google Tasks, Latitude, BBC news, etc etc
</p>
<h4>Step by step</h4>
<ol>
<li>First drag this link to your safari bookmark bar. <a href="javascript: var s = document.createElement('meta');s.setAttribute('name', 'apple-mobile-web-app-capable');s.setAttribute('content', 'yes');document.getElementsByTagName('head')[0].appendChild(s);void(s);var z = document.createElement('meta');z.setAttribute('viewport', 'apple-mobile-web-app-capable');z.setAttribute('content', 'width=device-width');document.getElementsByTagName('head')[0].appendChild(z);void(z);">Convert to WebApp</a></li>
<li>Sync your iPhone (with bookmark sync turned on)</li>
<li>Browse to a website you want to make a web clip of through Safari on your iPhone</li>
<li>Open your bookmarks and tap the one you just added to bookmark bar (nothing will appear to happen)</li>
<li>Then tap the + at the bottom of the screen</li>
<li>Select, “Add to Home Screen” and give it a sensible name.</li>
</ol>
<p>You can see here the diference between the BBC sport website with and without using the bookmarklet:</p>
<h4>Default</h4>
<p><a href="http://www.pixelbox.net/wp-content/uploads/2010/04/default.png"><img src="http://www.pixelbox.net/wp-content/uploads/2010/04/default-200x300.png" alt="How the BBC mobile site loads by default" title="Default" width="200" height="300" class="alignnone size-medium wp-image-424" /></a></p>
<h4>Saved as WebApp</h4>
<p><a href="http://www.pixelbox.net/wp-content/uploads/2010/04/webapp.png"><img src="http://www.pixelbox.net/wp-content/uploads/2010/04/webapp-200x300.png" alt="How the site looks when saved as a web app" title="webapp" width="200" height="300" class="alignnone size-medium wp-image-425" /></a></p>
<p>Enjoy!</p>
<p><strong>UPDATE</strong> It seems standard links on the first page open in Safari :( Still works well for Google web apps!</p>
<img src="http://feeds.feedburner.com/~r/Pixelbox/~4/WAB78p-i-3E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2010/04/08/save-as-iphone-web-app-bookmarklet/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.pixelbox.net/2010/04/08/save-as-iphone-web-app-bookmarklet/</feedburner:origLink></item>
		<item>
		<title>This file cannot be launched (by Flex/Flash Builder)</title>
		<link>http://feedproxy.google.com/~r/Pixelbox/~3/wTuA7JOoRL4/</link>
		<comments>http://www.pixelbox.net/2010/02/24/this-file-cannot-be-launched-by-flexflash-builder/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 12:07:50 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/?p=409</guid>
		<description><![CDATA[On an old project I had an annoying problem with Flex builder that meant only the main application&#8217;s MXML file would allow me to debug the application. If I tried to debug or run on another file in the project I would get the error, &#8220;This file cannot be launched&#8221;. In order to fix this, [...]]]></description>
			<content:encoded><![CDATA[<p>
On an old project I had an annoying problem with Flex builder that meant only the main application&#8217;s MXML file would allow me to debug the application. If I tried to debug or run on another file in the project I would get the error, &#8220;This file cannot be launched&#8221;.
</p>
<p>In order to fix this, all you need to do is make sure the folder/package with your files is added to the &#8216;runnable application files&#8217; in the Flex Applications tab of projects properties. If there are already added, just try adding again and it should resolve the issue.</p>
<p>Thanks to Jason San Jose for pointing this out to me!</p>
<img src="http://feeds.feedburner.com/~r/Pixelbox/~4/wTuA7JOoRL4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2010/02/24/this-file-cannot-be-launched-by-flexflash-builder/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.pixelbox.net/2010/02/24/this-file-cannot-be-launched-by-flexflash-builder/</feedburner:origLink></item>
		<item>
		<title>Adding plugins to Flash Builder 4</title>
		<link>http://feedproxy.google.com/~r/Pixelbox/~3/QdIFCEeIs2I/</link>
		<comments>http://www.pixelbox.net/2010/02/19/adding-plugins-to-flash-builder-4/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 15:18:57 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/?p=407</guid>
		<description><![CDATA[At the time of writing Flash Builder 4 doesn&#8217;t ship with the default plugin installers, which makes adding things like ANT a bit of a chore. UPDATE: The latest RC for Flash Builder 4 now supports plugins again. I have updated the links to include the Eclipse plugin URL for each plugin. This post is [...]]]></description>
			<content:encoded><![CDATA[<p>At the time of writing Flash Builder 4 doesn&#8217;t ship with the default plugin installers, which makes adding things like ANT a bit of a chore.</p>
<p>UPDATE: The latest RC for Flash Builder 4 now supports plugins again. I have updated the links to include the Eclipse plugin URL for each plugin.</p>
<p>This post is as much a reminder to me for future builds as it is for anyone else sick of having to manually look up where to down load the most common plugins every time they update. Start by downloading all the plug in files:</p>
<h3>ANT</h3>
<p>To get ANT installed you need to download and install JDT for eclipse.</p>
<p>Manual install: <a href="http://download.eclipse.org/eclipse/downloads/drops/R-3.5.1-200909170800/index.php">http://download.eclipse.org/eclipse/downloads/drops/R-3.5.1-200909170800/index.php</a></p>
<p>Eclipse update URL:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">http://download.eclipse.org/releases/galileo/</pre></div></div>

</p>
<h3>Flex Formatter</h3>
<p>Once you have used Flex Formatter you will never look back. It automatically formats your code, making you look like you have spent lots of time lining everything up. You can download the plugin files here <a href="http://sourceforge.net/projects/flexformatter/">http://sourceforge.net/projects/flexformatter/</a></p>
<p>Eclipse update URL:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">http://flexformatter.googlecode.com/svn/trunk/FlexFormatter/FlexPrettyPrintCommandUpdateSite</pre></div></div>

</p>
<h3>subclipse</h3>
<p>Subclipse is a must for anyone using SVN in their projects. It stops you running into a lot of problems, like turning up .svn files in search results. You can get it here<br />
<a href="http://subclipse.tigris.org/servlets/ProjectDocumentList?folderID=2240">http://subclipse.tigris.org/servlets/ProjectDocumentList?folderID=2240</a></p>
<p>Eclipse update URL:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">http://subclipse.tigris.org/update_1.6.x</pre></div></div>

</p>
<p>For the manual install, once you have downloaded and unzipped these files copy the content of their plugin folder to the plugin folder in your Flash Builder 4 directory. You may also want to copy the features folder content to the features folder in the Flash Builder 4 folder too.</p>
<p>Once done restart Flash Builder and everything should be working. </p>
<p>Also be sure to check out SourceMate (currently in Beta).</p>
<img src="http://feeds.feedburner.com/~r/Pixelbox/~4/QdIFCEeIs2I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2010/02/19/adding-plugins-to-flash-builder-4/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.pixelbox.net/2010/02/19/adding-plugins-to-flash-builder-4/</feedburner:origLink></item>
		<item>
		<title>More Xbox 360 problems</title>
		<link>http://feedproxy.google.com/~r/Pixelbox/~3/DmrSNmHTI-A/</link>
		<comments>http://www.pixelbox.net/2010/01/01/more-xbox-360-problems/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 19:43:30 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/?p=401</guid>
		<description><![CDATA[My 360 died again a few weeks ago, showing the all too common 3 red rings (read rings of death or RROD for short). The first time I had this problem it was still in warranty so Microsoft fixed it for me, the second time I had to send it off to a console repair [...]]]></description>
			<content:encoded><![CDATA[<p>My 360 died again a few weeks ago, showing the all too common 3 red rings (read rings of death or RROD for short). The first time I had this problem it was still in warranty so Microsoft fixed it for me, the second time I had to send it off to a console repair company, who apparently just reset it for me after a &#8220;diagnosis&#8221; came back OK. I was about to send it back off to them again, when I through I would have a look into fixing it myself, after all what better way to spend a hung over new years day.
</p>
<p>
You can find out what the problem is with your system by holding down the sync button then tapping the eject button. Each time you press it, you get a number, represented by flashing lights (<a href="http://www.youtube.com/watch?v=U56kfO7kj9g">video example</a>). I got 0022, which is apparently is an error form the GPU over heating. This was what I expected as the system kept freezing and displaying some odd stuff before the RROD appeared. There is a <a href="http://www.llamma.com/xbox360/repair/Xbox-360-error-codes.htm">huge list of error codes and their descriptions here</a>.
</p>
<p>
It seems the RROD are displayed when the system detects an error, and locks it down to stop it working. The only way you seem to be able to reset it, is to overhead the system. This can be done by the &#8220;towl trick&#8221; or better yet jamming the fans. Lots of examples of these can again be found on YouTube.  </p>
<p>
This didn&#8217;t work for me, so I did some more research for my error code 0022 and found this solution by <a href="http://www.fixya.com/users/xx_mimic_xx">xx_mimic_xx</a></p>
<blockquote cite="http://www.fixya.com/support/t459907-gpu_error_code_0022_xbox_360"><p>There is a very simple fix to this issue and I am not sure why it is not being talked about. I will have to make a video and post it for everyone to see, but in short, you need to overheat the GPU while keeping the CPU cool.<br />
Now, if you do not know what you are doing, I would wait until I make a video about it. However, if you are comfortable taking your Xbox apart then it is simple.<br />
You will need to disaseble the box all of the way down to removing the top cover and exposing the board. You do not need to remove the DVD or the fan, however you will need to take off the plastic piece that vents the fan air into the heat sinks. After you get that far, take the fan out of the case. DO NOT UNPLUG IT, as you will need it. Just pull it out of its holding spot. Next, you will want to move the DVD drive off to the side, away from the GPU heat sink, but leave it plugged in. Then set the fan on top of the CPU heat sink, the taller one, so that it does not overheat. Then turn your system on and let it RROD, then leave it on for about 10-15 min. What this will do is overheat the GPU and reflow the solder underneath it. After 10-15 min, turn your system off, let it cool, put it back together, and you should be good to go! I have done this on 3 systems that came up with error codes related to the CPU or GPU, and all 3 are now working again. Good luck!</p></blockquote>
<p>
So first off you need to get the case off, and in this modern age YouTube comes to the rescue with loads of really useful videos of people doing just that. Videos are great as I often find normal tutorials will miss something out the author thinks trivial (yet vital) or just aren&#8217;t very clear. After all seeing is believing. This one is as good as any: http://www.youtube.com/watch?v=qaxIB6cXTYM You don&#8217;t need any special tools, but the do make things easier (I was making the best of a swiss army knife)</p>
<p>Then as xx_mimic_xx said, you need to place the fan on the CPU (the taler one) and leave it for about 20 minutes. The system shouldn&#8217;t show the 2 flashing red rings when it overheats (as we a cooling the CPU). Instead the GPU should over heat and stay over headed apparently reflowing the solder.</p>
<p>Once done, let if cool for as long time and then hopefully it should turn back on without the RROD. You may need to do a standard overheat to reset the system though. It wont be a permeant fix mind, but should keep you going for a bit&#8230;</p>
<p>NOTE: Make sure not to be connected to Xbox live when your tinkering with your system, as it may ban you if it thinks you modding the system. Also make sure you careful when running the system with no covers, as there is a risk of electrocution and be sure to ground yourself too ;)</p>
<img src="http://feeds.feedburner.com/~r/Pixelbox/~4/DmrSNmHTI-A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2010/01/01/more-xbox-360-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.pixelbox.net/2010/01/01/more-xbox-360-problems/</feedburner:origLink></item>
		<item>
		<title>Caching gotcha in AIR</title>
		<link>http://feedproxy.google.com/~r/Pixelbox/~3/d5S4tDMAl9s/</link>
		<comments>http://www.pixelbox.net/2009/10/02/caching-gotcha-in-air/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 13:38:30 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/?p=379</guid>
		<description><![CDATA[Every had a problem with Adobe AIR caching your HTTP requests? Read on...]]></description>
			<content:encoded><![CDATA[<p>I recently ran into a problem in AIR, where my application wasn&#8217;t updating content it was getting from an HTTP request even though the page had changed.</p>
<p>I was able to use <a href="http://www.charlesproxy.com/">Charles Proxy</a> to see that the application wasn&#8217;t even making the requests to the server, meaning it must be an issue with AIR rather than local or remote DNS, or web servers.</p>
<p>My requests were being made by the HTTPService class, and I couldn&#8217;t find any properties of methods that where related to caching, however I did find that URLRequest had two properties, useCache and cacheResponce.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> urlRequest<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">URLRequest</span> = _new <span style="color: #004993;">URLRequest</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
urlRequest.cacheResponse = <span style="color: #0033ff; font-weight: bold;">false</span>;
urlRequest.useCache = <span style="color: #0033ff; font-weight: bold;">false</span>;</pre></div></div>

<p>
This is quite handy, although it didn&#8217;t seem to work for me, and also wasn&#8217;t idea for the situation I was in. After doing some digging on the web I found the classic solution of adding a random number to the end of the URL
</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">&nbsp;
&nbsp;
&nbsp;
 <span style="color: #6699cc; font-weight: bold;">var</span> urlRequest<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">URLRequest</span> = _new <span style="color: #004993;">URLRequest</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'http://www.example.com/'</span><span style="color: #000000;">&#41;</span>;
 urlRequest.<span style="color: #004993;">url</span> <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #990000;">'?nocache='</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">100</span>;</pre></div></div>

<p>
Again this isn&#8217;t ideal and could lead to problems, especially if you don&#8217;t know what server or URL the requests may be sent for. There is a chance the nocache (or any) variable could cause problems.
</p>
<p>
Eventually I noticed that the URLRequest&#8217;s cacheResponse entry on livedocs had a &#8220;See also&#8221; pointing to <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/URLRequestDefaults.html#cacheResponse">flash.net.URLRequestDefaults.cacheResponse</a>. This solved all my problems, and is essentially a default for all URL requests made my AIR.
</p>
<p>
The properties appear to be static variables so you can set them like so:
</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">// Turn caching off for AIR</span>
URLRequestDefaults.cacheResponse = <span style="color: #0033ff; font-weight: bold;">false</span>;
URLRequestDefaults.useCache = <span style="color: #0033ff; font-weight: bold;">false</span>;</pre></td></tr></table></div>

<p>
This only needs to be done once, so you can add it to your applications start up cycle.</p>
<img src="http://feeds.feedburner.com/~r/Pixelbox/~4/d5S4tDMAl9s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2009/10/02/caching-gotcha-in-air/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.pixelbox.net/2009/10/02/caching-gotcha-in-air/</feedburner:origLink></item>
		<item>
		<title>Extended AIR App Updater</title>
		<link>http://feedproxy.google.com/~r/Pixelbox/~3/8wxzCzuuq88/</link>
		<comments>http://www.pixelbox.net/2009/09/02/extended-air-app-updater/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 17:13:11 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/?p=347</guid>
		<description><![CDATA[Ever wished there was a way to force app updates using the ApplicationUpdaterUI? Now there is.]]></description>
			<content:encoded><![CDATA[<p>I have always used Adobe&#8217;s <a href="http://www.adobe.com/devnet/flex/tourdeflex/langref/air/update/ApplicationUpdaterUI.html">ApplicationUpdater</a> in my AIR apps, either with or without the UI. However every time I do I always find I need the functionality to force the user to update. This is normally due to an important feature or bug fix that I need pushed out to users, or just to make sure those users who never update don&#8217;t get too far behind (I recently found my dad had never updated any of his iPhone apps).
</p>
<p><div id="attachment_360" class="wp-caption alignnone" style="width: 310px"><img src="http://www.pixelbox.net/wp-content/uploads/2009/09/Picture-2-300x149.png" alt="Update framework" title="Update" width="300" height="149" class="size-medium wp-image-360" /><p class="wp-caption-text">Update framework</p></div>
<p>
When using the ApplicationUpdater (without the UI), you can easily force the install of all updates, but this isn&#8217;t very user friendly, and not a great experience. Often it&#8217;s far too time consuming to write your own UI for the update framework, so ideally I wanted to create a way of supporting required updates whilst using the existing UI as much as possible.
</p>
<p>
In order to do this I wrote a decorator for the ApplicationUpdaterUI which added the new event RequiredStatusUpdateEvent. This is dispatched when the updateDescriptor file is downloaded and includes the value of a new node called required (which you need to add to your update.xml file):
</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">&nbsp;
<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;update</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://ns.adobe.com/air/framework/update/description/1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> 
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://www.pixelbox.net/demos/extendedAppUpdater/ExampleAirApp-2.air<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		Version 2
		- Lots of great new features
		- Required security patch
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;required<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/required<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/update<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p><small>The text &#8220;true&#8221; will translate into a Boolean set to true, anything else will be false.</small></p>
</p>
<p>
You can then add a listener for the  (along with any default events), to tell your user they have to update to the new required version. This can be as simple as:
</p>

<div class="wp_syntax"><div class="code"><pre class="applicationscript3" style="font-family:monospace;">&nbsp;
           private function onUpdate(event:RequiredStatusUpdateEvent):void
            {
                if (event.required &amp;&amp; event.available)
                    // Required update available 
                else
                    // There isn't a required update, so leave it up to the ApplicationUpdaterUI
            }</pre></div></div>

<p>
From a UX point of view this works rather well. You can choose how your application responds to a required update, and don&#8217;t need to force the install in the background and restart the app. I like to change the state of the app, as well as letting the ApplicationUpdaterUI window open. If the user upgrades through the default UI, great, if not they will be presented with a new app state, telling them there is a required update, perhaps even why it&#8217;s important. You may even want to let them do some things but not others (such as letting them save their work, or finishing their current workflow). Either way it gives your app the choice of how it wants to behave.
</p>
<p>I have created a little example app (with view source enabled) that uses the this code, as well as a .swc and the example app as a project.</p>
<ul>
<li><a href="http://www.pixelbox.net/demos/extendedAppUpdater/ExampleAirApp-1.air">Example AIR Application</a></li>
<li><a href="http://www.pixelbox.net/demos/extendedAppUpdater/ExtendedAppUpdater.swc">Extended Updater swc file</a></li>
<li><a href="http://www.pixelbox.net/demos/extendedAppUpdater/ExampleAirApp.zip"> Example Air App project</a></li>
<li><a href="http://www.pixelbox.net/demos/extendedAppUpdater/update.xml"> Example update descriptor XML file</a></li>
</ul>
<p>If you install the above air file, you will be able to check for updates and receive a required update. When this happens the app&#8217;s main function is disabled and a message displayed telling the user to upgrade.</p>
<p>Please let me know if you have any questions, or would like to add to this little framework, good luck. If you want to create your own without using the default UI check out <a href="http://www.blackpepper.co.uk/black-pepper-blog/Example-auto-updating-AIR-desktop-app.html">this article on Black Pepper</a></p>
<img src="http://feeds.feedburner.com/~r/Pixelbox/~4/8wxzCzuuq88" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2009/09/02/extended-air-app-updater/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.pixelbox.net/2009/09/02/extended-air-app-updater/</feedburner:origLink></item>
		<item>
		<title>Detecting if running in ADL</title>
		<link>http://feedproxy.google.com/~r/Pixelbox/~3/U7quZhtQq5k/</link>
		<comments>http://www.pixelbox.net/2009/07/07/detecting-if-running-in-adl/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 14:39:11 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/?p=317</guid>
		<description><![CDATA[A quick example of how to tell when an AIR application is running in debug mode. Allowing you to stop costly tasks when doing so.]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-318" title="adl" src="http://www.pixelbox.net/wp-content/uploads/2009/07/adl.png" alt="" width="160" height="108" /></p>
<p><strong><br />
NOTE: I have since discovered the Capabilities class that has a boolean called isDebugger. Therefore you can do this like so:</strong>
</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">Capabilities</span>.<span style="color: #004993;">isDebugger</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'This app is running in the ADL'</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p><strong>Original post:</strong></p>
<p>I recently came across the situation where I wanted to detect if my AIR application was running, &#8220;for real&#8221; or running in debug mode (in the Adobe Debug Launcher ADL).</p>
<p>With a standard Flex &gt; SWF project you can change the HTML of the debug template to pass through a debug=true variable. However with an AIR project you don&#8217;t have this luxury.</p>
<p>The reason I want to do this, is I don&#8217;t want some things to happen when I&#8217;m debugging (such as sending stats to the server) and I don&#8217;t want to have custom variables or comment out code incase I forget to turn them back on before pushing live. By having a way of checking if the app is running in the ADL you can optionally stop things, safe in the knowledge that when they go live they will work.</p>
<p>I searched the web to see if there was a way to tell if AIR was running in debug mode, or in the ADL or was even a release build, but I couldn&#8217;t find a specific API call. What I did find is a number of methods that only worked if running in the ADL. All I had to do then was find one that returned different values depending on that fact. The Error class has a method getStackTrace() that return null if not running in the ADL and a string if it is, this was perfect and can be used like so:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Error</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">getStackTrace</span><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;">null</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'This app is running in the ADL'</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>This code isn&#8217;t perfect, in the future the getStackTrace method could start working when not running in the ADL. You could also combine a few ADL specific methods, for better piece of mind. If you know of a better solution please let me know!</p>
<img src="http://feeds.feedburner.com/~r/Pixelbox/~4/U7quZhtQq5k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2009/07/07/detecting-if-running-in-adl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.pixelbox.net/2009/07/07/detecting-if-running-in-adl/</feedburner:origLink></item>
		<item>
		<title>Arthropod</title>
		<link>http://feedproxy.google.com/~r/Pixelbox/~3/OnVdIJYwQeQ/</link>
		<comments>http://www.pixelbox.net/2009/04/01/arthropod/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 15:29:39 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/?p=316</guid>
		<description><![CDATA[A quick introduction to Arthropod, an AIR application for tracing debug messages to from another Flex or AIR application.]]></description>
			<content:encoded><![CDATA[<p>I have recently been working a lot with sub applications in Flex. Sub applications are a great way to brake a large application up into smaller more manageable parts, but also provide the potential for some really exciting ideas.
</p>
<p>
One of the biggest problems when using sub applications is the security violations that the Flash platform throws up. These are seen in the debugging console, and with most Flex projects the number and frequency of violations, mean the console becomes impossible to use.
</p>
<p>
Today I discovered <a href="http://arthropod.stopp.se">Arthropod</a>. Arthropod is an AIR application that offers a console that you can log to from a SWF (Flex, AIR, Flash applications or movies). All you need to do is include a simple class, and then log your debugging messages like so:</p>
<p><</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&gt;</span>Debug.<span style="color: #004993;">log</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;my message&quot;</span><span style="color: #000000;">&#41;</span>;</pre></div></div>

<p>
Arthropod uses the local connection to communicate with the desktop application, and although currently only supports AS3, it should be possible to get an AS2 version running too.
</p>
<p>
This means I can now debug to Arthropod and don&#8217;t need to use the default flex builder debug console. However Arthropod also allows you to do a lot more, by debugging applications in their live environment. For more info check out <a href="http://arthropod.stopp.se">http://arthropod.stopp.se</a></p>
<img src="http://feeds.feedburner.com/~r/Pixelbox/~4/OnVdIJYwQeQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2009/04/01/arthropod/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.pixelbox.net/2009/04/01/arthropod/</feedburner:origLink></item>
		<item>
		<title>Sub application communication in AIR</title>
		<link>http://feedproxy.google.com/~r/Pixelbox/~3/SmQaVJqaIWg/</link>
		<comments>http://www.pixelbox.net/2009/02/11/sub-application-communication-in-air/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 16:29:02 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/?p=314</guid>
		<description><![CDATA[Some information on running sub applications in AIR. Sub applications give you great flexibility, but also present a lot of security issues, not to mention debugging problems. Be sure to check out the working example too!]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.pixelbox.net/demos/AirSubApplication/ParentApplication.air"><img src="http://www.pixelbox.net/wp-content/uploads/2009/02/picture-1-300x237.png" alt="" title="picture-1" width="300" height="237" class="alignnone size-medium wp-image-315" /></a>
<p>
If you are interested in developing large application in Flex, it&#8217;s a good idea to break up parts into modues or separate application. This encourages loose coupling, improves the ease of updating and out sourcing development.
</p>
<p>
If your project is an AIR application then you will probibly want to load those modules locally (rather than rely on the web) and download/update them at runtime, rather than having to package them with your applicaiton. If this is the case you will no dout run into a host of problems involving application and security domains.
</p>
<p>
Adobe support this concept using the, &#8220;<a title="The Marshall Plan" href="http://opensource.adobe.com/wiki/display/flexsdk/Marshall+Plan">Marshall Plan</a>&#8220;, an environment for protecting your main application from the many porential risks of downloading excutiable code. Be sure to read the <a href="http://blogs.adobe.com/flexdoc/loadingSubApps.pdf">58 pages of info in this PDF</a>.
</p>
<p>
The key points of the Marshall Plan are, Application Domains, and Secutiry Domains. In a nut shell, Application domains seperate class definitions (so you can use the same framework/singletons in each app) and security domains protect against applicaitons traversing into their reletaves.
</p>
<p>
If you want to do anything slightly complicated with your sub applications (RPC, use frameworks, etc) you will need to load them into a separate application and security domain. This does cause some problems with your sub application&#8217;s components that try and access high level objects (like stage and mouse), but apparently you can work around these :/
</p>
<p>
One of the first hurdles in running sub applications in seperate security and application domains is communication. The Marshall Plan has restricted communication in AIR down to a single shared EventDispatcher called sharedEvents, which is located inside the loaderInfo for the SWFLoader and the subApplication. Documentation on this is non existant, and I found myself routing around in debug mode trying to find the correct reference, and here it is:
</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900;">// From the parent app where mySubApp is an instance of SWFLoader</span>
<span style="color: #6699cc; font-weight: bold;">var</span> e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Event</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'testFromParent'</span><span style="color: #000000;">&#41;</span>;
mySubApp.<span style="color: #004993;">content</span>.<span style="color: #004993;">loaderInfo</span>.<span style="color: #004993;">sharedEvents</span>.<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span>e<span style="color: #000000;">&#41;</span>;
mySubApp.<span style="color: #004993;">content</span>.<span style="color: #004993;">loaderInfo</span>.<span style="color: #004993;">sharedEvents</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> <span style="color: #990000;">'testFromSubApp'</span> , _eventFromSubApp <span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #009900;">// From the sub app</span>
<span style="color: #6699cc; font-weight: bold;">var</span> e <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Event</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Event</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'testFromSubApp'</span><span style="color: #000000;">&#41;</span>;
<span style="color: #0033ff; font-weight: bold;">this</span>.systemManager.<span style="color: #004993;">loaderInfo</span>.<span style="color: #004993;">sharedEvents</span>.<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span>e<span style="color: #000000;">&#41;</span>;
<span style="color: #0033ff; font-weight: bold;">this</span>.systemManager.<span style="color: #004993;">loaderInfo</span>.<span style="color: #004993;">sharedEvents</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> <span style="color: #990000;">'testFromParent'</span> , _testEventHandler<span style="color: #000000;">&#41;</span>;</pre></div></div>

</p>
<p>
That right there is the basics of communicating between the two. Untyped objects can also be passed through, and typed objects (like ArrayCollections) will be converted to generic objects. They key is knowing to use the loaderInfo in the, &#8220;content&#8221; of the SWFLoader, and that the loaderInfo in the child app is in the systemManager.
</p>
<p>
I have created a demo AIR application that downloads a sub application, stores it locally, loads it in, and shows them both communicating.
</p>
<p>
<a href="http://www.pixelbox.net/demos/AirSubApplication/SubApplicationBridge.zip">Download the source code here</a> or <a href="http://www.pixelbox.net/demos/AirSubApplication/ParentApplication.air">just the AIR application</a>.
</p>
<p>
<img src="http://feeds.feedburner.com/~r/Pixelbox/~4/SmQaVJqaIWg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2009/02/11/sub-application-communication-in-air/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.pixelbox.net/2009/02/11/sub-application-communication-in-air/</feedburner:origLink></item>
		<item>
		<title>UI Navigation question</title>
		<link>http://feedproxy.google.com/~r/Pixelbox/~3/kimo8DA5lDQ/</link>
		<comments>http://www.pixelbox.net/2009/01/23/ui-navigation-question/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 18:01:04 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/?p=311</guid>
		<description><![CDATA[A quick question to see which of these icons would make most sense to you in a desktop application.]]></description>
			<content:encoded><![CDATA[<p><a href='http://www.pixelbox.net/wp-content/uploads/2009/01/ui_question.jpg'><img src="http://www.pixelbox.net/wp-content/uploads/2009/01/ui_question-300x164.jpg" alt="ui_question" title="ui_question" width="300" height="164" class="alignnone size-medium wp-image-312" /></a>
<p>Question to ponder over the weekend.</p>
<p>You have a list of articles that scroll vertically in a desktop app.</p>
<p>
When you click on an article to view in full you have navigation arrows to go to the next and previous article.</p>
<p>
Do the buttons point up and down, to mimic scrolling on the previous screen?</p>
<p>
Do they point left and right like iTunes which also displays songs vertically?</p>
<p>Answers on a post card.</p>
<img src="http://feeds.feedburner.com/~r/Pixelbox/~4/kimo8DA5lDQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2009/01/23/ui-navigation-question/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.pixelbox.net/2009/01/23/ui-navigation-question/</feedburner:origLink></item>
	</channel>
</rss>
