<?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>Serge Jespers &#187; code</title>
	<atom:link href="http://www.webkitchen.be/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webkitchen.be</link>
	<description>Life as an Adobe platform evangelist</description>
	<lastBuildDate>Tue, 31 Jan 2012 17:35:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using Growl in AIR applications with AIR 2 NativeProcess</title>
		<link>http://www.webkitchen.be/2010/03/15/using-growl-in-air-applications-with-air-2/</link>
		<comments>http://www.webkitchen.be/2010/03/15/using-growl-in-air-applications-with-air-2/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 10:39:15 +0000</pubDate>
		<dc:creator>Serge Jespers</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[air2]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[growl]]></category>
		<category><![CDATA[growlnotify]]></category>
		<category><![CDATA[nativeprocess]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://www.webkitchen.be/?p=2262</guid>
		<description><![CDATA[The AIR2 release is just around the corner and one of my favorite new features is the ability to use native scripts. As I&#8217;ve already demonstrated earlier, this is extremely powerful and here&#8217;s another good example. From the moment AIR was released, a lot of developers were asking for Growl support to add toast style [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.webkitchen.be%2F2010%2F03%2F15%2Fusing-growl-in-air-applications-with-air-2%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.webkitchen.be%2F2010%2F03%2F15%2Fusing-growl-in-air-applications-with-air-2%2F&amp;source=sjespers&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f11b21ad05448f9b4029b73b124e8d0e&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>The AIR2 release is just around the corner and one of my favorite new features is the ability to use native scripts. As I&#8217;ve already <a href="http://www.webkitchen.be/2009/12/17/introducing-package-assistant-air-2-package-utility-built-with-air-2/" target="_blank">demonstrated earlier</a>, this is extremely powerful and here&#8217;s another good example.</p>
<p>From the moment AIR was released, a lot of developers were asking for <a href="http://growl.info/" target="_blank">Growl</a> support to add toast style notifications. Up until now, there hasn&#8217;t really been an easy and flexible solution so most developers opted to build their own notifications. I really like Growl and the fact that you as a user have total control over the look and feel. I use the Mono style created by <a href="http://fixedgear.ca/" target="_blank">Christopher Lobay</a>. It&#8217;s probably the sexiest toast style notification I&#8217;ve ever used.</p>
<p>With AIR 2 you can now call Growl right from within your application. I actually call the <a href="http://growl.info/documentation/growlnotify.php" target="_blank">Growlnotify</a> command-line tool, which comes as an extra in the Growl download. Most people probably don&#8217;t install these extras but that&#8217;s no problem. I can bundle the command-line tool as part of my application and call it directly from my applicationDirectory.</p>
<p>So&#8230; How does this work? It&#8217;s actually extremely easy&#8230; The first thing you do is set up a new File object that points to the Growlnotify tool.</p>
<pre>
var file:File = File.applicationDirectory;
file = file.resolvePath(&quot;growlnotify&quot;);
</pre>
<p>As I am going to bundle growlnotify with my application it will just be installed as part of the app and thus resides in applicationDirectory.</p>
<p>The next thing I have to do is set up a NativeProcessStartupInfo object. That&#8217;s where I&#8217;ll store the basic information that is used to start our NativeProcess.</p>
<pre>
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var processArgs:Vector.&lt;String&gt; = new Vector.&lt;String&gt;();
processArgs[0] = &quot;-n&quot;;
processArgs[1] = &quot;My AIR application&quot;;
processArgs[2] = &quot;-p&quot;;
processArgs[3] = &quot;0&quot;;
processArgs[4] = &quot;-t&quot;;
processArgs[5] = &quot;Your Growl title&quot;;
processArgs[6] = &quot;-m&quot;;
processArgs[7] = &quot;Your Growl message&quot;;
processArgs[8] = &quot;-a&quot;;
processArgs[9] = &quot;Adobe AIR Application Installer&quot;;
nativeProcessStartupInfo.arguments = processArgs;
nativeProcessStartupInfo.executable = file;
</pre>
<p>In this case, I&#8217;m also adding a bunch of arguments in my NativeProcessStartupInfo object. These arguments will be passed on to the growlnotify command-line tool. In this example, I&#8217;m setting up the name of my application, the notification priority, the title and message of my notification and I&#8217;m also telling it to use the icon associated with the Adobe AIR Application Installer. (Check out the <a href="http://growl.info/documentation/growlnotify.php" target="_blank">Growlnotify docs</a> for more info on these settings)</p>
<p>Next and last step is to actually call the native script.</p>
<pre>
process = new NativeProcess();
process.start(nativeProcessStartupInfo);
</pre>
<p>This code above will result in this Growl notification:</p>
<pre style="text-align: center;"><img class="aligncenter size-full wp-image-2266" title="growlnotify_air2" src="http://www.webkitchen.be/wp-content/uploads/2010/03/growlnotify_air2.jpg" alt="" width="309" height="92" /></pre>
<p>The only downside of using native scripts is that you&#8217;ll have to package your application specifically for the operating system you wrote your native script for. So in this case, I&#8217;d have to package it as a .DMG file since Growl only exists on OS X. That said, I really wouldn&#8217;t mind an OS X version of TweetDeck that allows me to use Growl instead of their custom notifications&#8230;</p>
<p>I really can&#8217;t wait to see what you guys are going to build with AIR 2! You can already start today! Check out <a href="http://labs.adobe.com/" target="_blank">Adobe Labs</a> for more information!</p>
<iframe id="basic_facebook_social_plugins_likebutton" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.webkitchen.be%2F2010%2F03%2F15%2Fusing-growl-in-air-applications-with-air-2%2F&amp;layout=standard&amp;show_faces=true&amp;width=500&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:500px; height:75px"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.webkitchen.be/2010/03/15/using-growl-in-air-applications-with-air-2/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Meet the downloadable evangelist</title>
		<link>http://www.webkitchen.be/2008/11/17/meet-the-downloadable-evangelist/</link>
		<comments>http://www.webkitchen.be/2008/11/17/meet-the-downloadable-evangelist/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 15:06:46 +0000</pubDate>
		<dc:creator>Serge Jespers</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[MAX2008]]></category>
		<category><![CDATA[blazeds]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[samples]]></category>
		<category><![CDATA[tour de flex]]></category>

		<guid isPermaLink="false">http://www.webkitchen.be/?p=461</guid>
		<description><![CDATA[Have you ever wished you had an evangelist by your side every day? Oh&#8230; Really? Now that&#8217;s just weird ;-) But seriously, it&#8217;s always a good thing to be able to tap in to someone&#8217;s brain when you get stuck on something or forgot about a component&#8217;s capabilities and properties. Or maybe you just want [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F11%2F17%2Fmeet-the-downloadable-evangelist%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F11%2F17%2Fmeet-the-downloadable-evangelist%2F&amp;source=sjespers&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f11b21ad05448f9b4029b73b124e8d0e&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Have you ever wished you had an evangelist by your side every day? Oh&#8230; Really? Now that&#8217;s just weird ;-) But seriously, it&#8217;s always a good thing to be able to tap in to someone&#8217;s brain when you get stuck on something or forgot about a component&#8217;s capabilities and properties. Or maybe you just want to browse the Flex component library to get an idea of its power and possibilities.</p>
<p style="text-align: center;"><img class="size-full wp-image-462" title="screenshots-large-500_0" src="http://www.webkitchen.be/wp-content/uploads/2008/11/screenshots-large-500_0.png" alt="" width="500" height="451" /></p>
<p>Enter the downloadable evangelist <a href="http://flex.org/tour" target="_blank">Tour de Flex</a>, a really cool AIR application that showcases core Flex components, AIR capabilities, Flex data access (BlazeDS and LiveCycle Data Services), numerous coding techniques, cloud APIs, and a growing list of community-developed components, effects, skins, and more. There are currently 217 code samples in the application but since this is an AIR application, it&#8217;s obvious that we will be updating that with new samples on a regular basis.</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-463" title="418842272_sr9hk-x3" src="http://www.webkitchen.be/wp-content/uploads/2008/11/418842272_sr9hk-x3.png" alt="" width="500" height="310" /></p>
<p>Tour De Flex also comes with an Eclipse plugin that allows the various samples to be searched directly from an Eclipse view window.</p>
<p>If you are at MAX, come and find one of us (we&#8217;re wearing a Tour de Flex shirt today) to get one of the Tour De Flex USB sticks or go ahead and download it from <a href="http://flex.org/tour" target="_blank">http://flex.org/tour</a>.</p>
<p>Kudos to <a href="http://gregsramblings.com" target="_blank">Greg Wilson</a>, <a href="http://coenraets.org/" target="_blank">Christophe Coenraets</a> and <a href="http://jamesward.com/" target="_blank">James Ward</a> who started this idea.</p>
<iframe id="basic_facebook_social_plugins_likebutton" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F11%2F17%2Fmeet-the-downloadable-evangelist%2F&amp;layout=standard&amp;show_faces=true&amp;width=500&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:500px; height:75px"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.webkitchen.be/2008/11/17/meet-the-downloadable-evangelist/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Signing AIR applications</title>
		<link>http://www.webkitchen.be/2008/06/16/signing-air-applications/</link>
		<comments>http://www.webkitchen.be/2008/06/16/signing-air-applications/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 09:30:17 +0000</pubDate>
		<dc:creator>Serge Jespers</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[onAIR Tour]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[deploying]]></category>
		<category><![CDATA[onAIR]]></category>
		<category><![CDATA[signing]]></category>
		<category><![CDATA[tour]]></category>
		<category><![CDATA[updating]]></category>

		<guid isPermaLink="false">http://www.webkitchen.be/?p=143</guid>
		<description><![CDATA[My presentation at the On AIR tour through Europe was about signing, deploying and updating your AIR applications. If you didn&#8217;t make it to the tour or just want to read up on these topics, I wrote three separate posts about them on the train somewhere between Prague and Munich. First of all, why is [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F06%2F16%2Fsigning-air-applications%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F06%2F16%2Fsigning-air-applications%2F&amp;source=sjespers&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f11b21ad05448f9b4029b73b124e8d0e&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<div class="note">My presentation at the On AIR tour through Europe was about <a href="http://www.webkitchen.be/2008/06/16/signing-air-applications" target="_blank">signing</a>, <a href="http://www.webkitchen.be/2008/06/16/deploying-air-applications/" target="_blank">deploying</a> and <a href="http://www.webkitchen.be/2008/06/16/updating-air-applications/" target="_blank">updating</a> your AIR applications. If you didn&#8217;t make it to the tour or just want to read up on these topics, I wrote three separate posts about them on the train somewhere between Prague and Munich.</div>
<p>First of all, why is signing an application important? Easy. When your application is unsigned or signed with a self-signed certificate, the user will get two red icons on the install screen. The first one is related to your code signing certificate. It&#8217;s telling you that the &#8220;publisher is unknown&#8221; which is very normal since we have no idea who actually signed this application.</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-121 aligncenter" title="unknown" src="http://www.webkitchen.be/wp-content/uploads/2008/05/unknown.jpg" alt="" width="354" height="42" /></p>
<p>When you do get a code signing certificate and sign the application with it, the icon will turn green or in some cases yellow. The yellow icon will appear when you are using the file I/O API.</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-120 aligncenter" title="known" src="http://www.webkitchen.be/wp-content/uploads/2008/05/known.jpg" alt="" width="354" height="31" /></p>
<p><span id="more-143"></span><br />
So where do you get a code signing certificate? Well, maybe you already have one. If you already bought one to sign Java or Cocoa applications for instance, chances are that this certificate is 100% compatible and you can use that. To make sure, check that your certificate is a Class 3 code signing certificate and you should be ready to go. If you don&#8217;t have, there&#8217;s a number of companies like Thawte.com that actually sell these. But if you upload your application to the <a href="http://www.adobe.com/go/marketplace" target="_blank">Adobe AIR marketplace</a>, you may get a complimentary code signing certificate from us. More info <a href="http://www.adobe.com/products/air/assets/popup/thawte_popup.html" target="_blank">here</a>.</p>
<p>I&#8217;m mainly using Flex for AIR development but the workflow is very similar in Flash or Dreamweaver. In case of Flex, you are actually going to build a release version of your application. To do that, you click the &#8220;export release build&#8221;-button. That will popup a little wizard window. In the first window, you can specify where you want to save your .AIR file. In this case, I&#8217;m saving it on the desktop.<br />
<a href="http://www.adobe.com/go/marketplace" target="_blank"></a></p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-145 aligncenter" title="exportreleasebuild" src="http://www.webkitchen.be/wp-content/uploads/2008/06/exportreleasebuild.jpg" alt="" width="450" height="407" /></p>
<p>When you click &#8220;next&#8221;, Flex will ask you to specify which digital certificate you want to use. If you don&#8217;t have one but still want to build a .AIR file for testing, click on the &#8220;create&#8221; button. When you fill out all the details of that form, you can save that self signed certificate so you don&#8217;t have to fill out that form every time. I saved mine in my home folder. Once you have created it, you can easily reuse it by just entering your password.</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-146 aligncenter" title="exportreleasebuild2" src="http://www.webkitchen.be/wp-content/uploads/2008/06/exportreleasebuild2.jpg" alt="" width="450" height="407" /></p>
<p>If you already have a code signing certificate, you can browse to the location you saved it to use it. Click &#8220;finish&#8221; and your AIR file is going to be baked. That&#8217;s it.</p>
<iframe id="basic_facebook_social_plugins_likebutton" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F06%2F16%2Fsigning-air-applications%2F&amp;layout=standard&amp;show_faces=true&amp;width=500&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:500px; height:75px"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.webkitchen.be/2008/06/16/signing-air-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get a complimentary code signing certificate</title>
		<link>http://www.webkitchen.be/2008/05/20/get-a-complimentary-code-signing-certificate/</link>
		<comments>http://www.webkitchen.be/2008/05/20/get-a-complimentary-code-signing-certificate/#comments</comments>
		<pubDate>Tue, 20 May 2008 07:46:59 +0000</pubDate>
		<dc:creator>Serge Jespers</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[known]]></category>
		<category><![CDATA[marketplace]]></category>
		<category><![CDATA[publisher identity]]></category>
		<category><![CDATA[signing]]></category>
		<category><![CDATA[thawte]]></category>
		<category><![CDATA[unknown]]></category>

		<guid isPermaLink="false">http://www.webkitchen.be/?p=119</guid>
		<description><![CDATA[If you&#8217;ve already published an AIR application, chances are you did that by using a self signed code&#160;certificate. When you installed the app, the AIR installer told you that the publisher&#8217;s identity is unknown. If you get a code signing certificate from a company like Thawte.com and use that to sign your application, it&#8217;s obvious [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F05%2F20%2Fget-a-complimentary-code-signing-certificate%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F05%2F20%2Fget-a-complimentary-code-signing-certificate%2F&amp;source=sjespers&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f11b21ad05448f9b4029b73b124e8d0e&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>If you&#8217;ve already published an AIR application, chances are you did that by using a self signed code&nbsp;certificate. When you installed the app, the AIR installer told you that the publisher&#8217;s identity is unknown.</p>
<p style="text-align: center;"><img class="alignnone size-medium wp-image-121 aligncenter" title="publisher unknown" src="http://www.webkitchen.be/wp-content/uploads/2008/05/unknown-300x35.jpg" alt="" width="300" height="35" /></p>
<p>If you get a code signing certificate from a company like <a href="http://www.thawte.com/" target="_blank">Thawte.com</a> and use that to sign your application, it&#8217;s obvious that your identity has been verified. The AIR installer will show that your identity is known.</p>
<p style="text-align: center;"><img class="alignnone size-medium wp-image-120 aligncenter" title="known" src="http://www.webkitchen.be/wp-content/uploads/2008/05/known-300x26.jpg" alt="" width="300" height="26" /></p>
<p>If you upload your application to the <a href="http://www.adobe.com/go/marketplace" target="_blank">Adobe AIR Marketplace</a> now, you are eligible to receive one Thawte code signing certificate (1 year Class 3 code signing certificate) from Adobe. As this is purely available on a first-come, first-served basis and supplies are limited, you might not want to wait too long to upload your app.</p>
<p>Read&nbsp;<a href="http://www.adobe.com/products/air/assets/popup/thawte_popup.html" target="_blank">details here</a>&nbsp;and then&nbsp;go upload your app on the <a href="http://www.adobe.com/go/marketplace" target="_blank">Adobe AIR Marketplace</a>.&nbsp;</p>
<iframe id="basic_facebook_social_plugins_likebutton" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F05%2F20%2Fget-a-complimentary-code-signing-certificate%2F&amp;layout=standard&amp;show_faces=true&amp;width=500&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:500px; height:75px"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.webkitchen.be/2008/05/20/get-a-complimentary-code-signing-certificate/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Play video in your dock with AIR</title>
		<link>http://www.webkitchen.be/2008/03/07/play-video-in-your-dock-with-air/</link>
		<comments>http://www.webkitchen.be/2008/03/07/play-video-in-your-dock-with-air/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 07:05:27 +0000</pubDate>
		<dc:creator>Serge Jespers</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[dock]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[nativeapplication.nativeapplication.icon]]></category>
		<category><![CDATA[systemtray]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.webkitchen.be/2008/03/07/play-video-in-your-dock-with-air/</guid>
		<description><![CDATA[A while back I was thinking if it would be possible to play video in the dock icon with AIR. Then I heard Lee Brimelow ask the same question during his FITC Amsterdam presentation. Last week I had a free moment during the Zurich AIR camp to give it a try and yes&#8230; it does [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F03%2F07%2Fplay-video-in-your-dock-with-air%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F03%2F07%2Fplay-video-in-your-dock-with-air%2F&amp;source=sjespers&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f11b21ad05448f9b4029b73b124e8d0e&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://www.webkitchen.be/wp-content/uploads/2008/03/dockvid.jpg" alt="dockvideo screenshot" align="left" />A while back I was thinking if it would be possible to play video in the dock icon with AIR. Then I heard <a href="http://theflashblog.com" title="Lee Brimelow's site" target="_blank">Lee Brimelow</a> ask the same question during his FITC Amsterdam presentation. Last week I had a free moment during the Zurich AIR camp to give it a try and yes&#8230; it does work.</p>
<p>First of all let&#8217;s think about use-cases for this. Imagine having a video player and when you minimize the app, you can continue watching your video in the dock. Obviously, this will still use the resources needed to actually play the video but I think it&#8217;s really cool and wouldn&#8217;t actually mind seeing this in an application like the Adobe Media Player. You could even have the user set this option in a prefs panel etc&#8230;<span id="more-27"></span></p>
<p>Not many people know this but you can programatically set the icon of your AIR application. <a href="http://weblogs.macromedia.com/cantrell/" target="_blank">Christian Cantrell</a>&#8216;s TimeSlide application demo&#8217;s how this is done. The source code for that application is available on <a href="http://code.google.com/p/timeslide/" target="_blank">Google Code</a> but I&#8217;ll give you the basics here. I&#8217;m sure you&#8217;ll be surprised of how easy this is.</p>
<p>To change the dockIcon, you just have to set the NativeApplication.nativeApplication.icon.bitmaps object.</p>
<blockquote><p>AIR creates the NativeApplication.nativeApplication.icon object automatically. The object type is either DockIcon or SystemTrayIcon, depending on the operating system. You can determine which of these InteractiveIcon subclasses that AIR supports on the current operating system using the NativeApplication.supportsDockIcon and NativeApplication.supportsSystemTrayIcon properties. The InteractiveIcon base class provides the properties width, height, and bitmaps, which you can use to change the image used for the icon.</p></blockquote>
<p>In this case, all I do is change that bitmap &#8220;onEnterFrame&#8221; by first drawing the video in a BitmapData object and then adding that BitmapData object to NativeApplication.nativeApplication.icon.bitmaps :</p>
<pre lang="actionscript">var iconData:BitmapData = new BitmapData(128, 128, true, 0x00000000);
iconData.draw(myVid);
NativeApplication.nativeApplication.icon.bitmaps = [iconData];</pre>
<p>The Windows equivalent to the dock icon, is the system tray icon&#8230; and yes&#8230; it is possible to play video in there too. But it&#8217;s obvious that a 16x16px view of your video is somewhat harder to see compared to the 128x128px icon on the Mac.</p>
<p>I&#8217;m still polishing the app and I&#8217;m going to add some controls etc but I do plan on releasing both the app and source right here next week. One other thing I want to try also is to make the icon bounce to a beat of say a music video I played in the player&#8230; That sounds cool to me :D So stay tuned&#8230;</p>
<iframe id="basic_facebook_social_plugins_likebutton" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F03%2F07%2Fplay-video-in-your-dock-with-air%2F&amp;layout=standard&amp;show_faces=true&amp;width=500&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:500px; height:75px"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.webkitchen.be/2008/03/07/play-video-in-your-dock-with-air/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

