<?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>rel=me &#187; AIR</title>
	<atom:link href="http://rel.me/c/air/feed/" rel="self" type="application/rss+xml" />
	<link>http://rel.me</link>
	<description>programming, objective-c, cocoa, iphone, c</description>
	<lastBuildDate>Mon, 02 Aug 2010 20:09:36 +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>Memory usage during file upload in AIR</title>
		<link>http://rel.me/2008/03/29/memory-usage-during-file-upload-in-air/</link>
		<comments>http://rel.me/2008/03/29/memory-usage-during-file-upload-in-air/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 00:47:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">/2008/03/29/memory-usage-during-file-upload-in-air</guid>
		<description><![CDATA[Uploading files in AIR is a little bit problematic these days. Here is the code: &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;mx:WindowedApplication xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;absolute&#34; showStatusBar=&#34;false&#34; initialize=&#34;onInitialize(event)&#34;&#62; &#160; &#60;mx:Script&#62; &#60;!&#91;CDATA&#91; &#160; import com.rwnage.s3.service.S3PostOptions; import flash.events.Event; &#160; public function onInitialize&#40;event:Event&#41;:void &#123; var accessKey:String = &#34;0RXZ3R7Y034PA8VGNWR2&#34;; var bucketName:String = &#34;rwnage_test&#34;; var objectName:String = &#34;test_file&#34;; var contentType:String = &#34;application/octet-stream&#34;; var secretAccessKey:String = [...]]]></description>
			<content:encoded><![CDATA[<p>Uploading files in AIR is a little bit problematic these days.</p>
<p>Here is the code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span class="sy0">&lt;</span>?<span class="kw3">xml</span> <span class="kw3">version</span>=<span class="st0">&quot;1.0&quot;</span> encoding=<span class="st0">&quot;utf-8&quot;</span>?<span class="sy0">&gt;</span>
<span class="sy0">&lt;</span>mx:WindowedApplication xmlns:mx=<span class="st0">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout=<span class="st0">&quot;absolute&quot;</span> showStatusBar=<span class="st0">&quot;false&quot;</span> 
  initialize=<span class="st0">&quot;onInitialize(event)&quot;</span><span class="sy0">&gt;</span>  
&nbsp;
  <span class="sy0">&lt;</span>mx:Script<span class="sy0">&gt;</span>
    <span class="sy0">&lt;!</span><span class="br0">&#91;</span>CDATA<span class="br0">&#91;</span>
&nbsp;
      <span class="kw3">import</span> com.<span class="me1">rwnage</span>.<span class="me1">s3</span>.<span class="me1">service</span>.<span class="me1">S3PostOptions</span>;
      <span class="kw3">import</span> flash.<span class="me1">events</span>.<span class="me1">Event</span>;
&nbsp;
      <span class="kw3">public</span> <span class="kw2">function</span> onInitialize<span class="br0">&#40;</span>event:Event<span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span>
        <span class="kw2">var</span> accessKey:<span class="kw3">String</span> = <span class="st0">&quot;0RXZ3R7Y034PA8VGNWR2&quot;</span>;
        <span class="kw2">var</span> bucketName:<span class="kw3">String</span> = <span class="st0">&quot;rwnage_test&quot;</span>;
        <span class="kw2">var</span> objectName:<span class="kw3">String</span> = <span class="st0">&quot;test_file&quot;</span>;
        <span class="kw2">var</span> <span class="kw3">contentType</span>:<span class="kw3">String</span> = <span class="st0">&quot;application/octet-stream&quot;</span>;
        <span class="kw2">var</span> secretAccessKey:<span class="kw3">String</span> = <span class="st0">&quot;[PUT YOUR SECRET ACCESS KEY HERE]&quot;</span>;      
&nbsp;
        <span class="kw2">var</span> postOptions:S3PostOptions = <span class="kw2">new</span> S3PostOptions<span class="br0">&#40;</span>bucketName, objectName, accessKey, 
          <span class="br0">&#123;</span> <span class="kw3">contentType</span>: <span class="kw3">contentType</span> <span class="br0">&#125;</span><span class="br0">&#41;</span>;
&nbsp;
        <span class="kw2">var</span> policy:<span class="kw3">String</span> = postOptions.<span class="me1">getPolicy</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;
        <span class="kw2">var</span> signature:<span class="kw3">String</span> = postOptions.<span class="me1">getSignature</span><span class="br0">&#40;</span>secretAccessKey, policy<span class="br0">&#41;</span>;
&nbsp;
        <span class="kw3">html</span>.<span class="kw3">htmlText</span> = <span class="st0">'&lt;html&gt;&lt;body&gt; <span class="es0">\</span>
          &lt;form name=&quot;upload&quot; action=&quot;http://'</span> + bucketName + <span class="st0">'.s3.amazonaws.com/&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt; <span class="es0">\</span>
            Key to upload: &lt;input type=&quot;input&quot; name=&quot;key&quot; value=&quot;'</span> + objectName + <span class="st0">'&quot; /&gt;&lt;br /&gt; <span class="es0">\</span>
            Content-Type: &lt;input type=&quot;input&quot; name=&quot;Content-Type&quot; value=&quot;'</span> + <span class="kw3">contentType</span> + <span class="st0">'&quot; /&gt;&lt;br /&gt; <span class="es0">\</span>
            &lt;input type=&quot;hidden&quot; name=&quot;AWSAccessKeyId&quot; value=&quot;'</span> + accessKey + <span class="st0">'&quot; /&gt; <span class="es0">\</span>
            &lt;input type=&quot;hidden&quot; name=&quot;Policy&quot; value=&quot;'</span> + policy + <span class="st0">'&quot; /&gt; <span class="es0">\</span>
            &lt;input type=&quot;hidden&quot; name=&quot;Signature&quot; value=&quot;'</span> + signature + <span class="st0">'&quot; /&gt; <span class="es0">\</span>
            File: &lt;input type=&quot;file&quot; name=&quot;file&quot; /&gt; &lt;br /&gt; <span class="es0">\</span>
            &lt;!-- The elements after this will be ignored --&gt; <span class="es0">\</span>
            &lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Upload to Amazon S3&quot; /&gt; <span class="es0">\</span>
          &lt;/form&gt;&lt;/body&gt;&lt;/html&gt;'</span>;                                                     
      <span class="br0">&#125;</span>
&nbsp;
    <span class="br0">&#93;</span><span class="br0">&#93;</span><span class="sy0">&gt;</span>
  <span class="sy0">&lt;/</span>mx:Script<span class="sy0">&gt;</span>
&nbsp;
  <span class="sy0">&lt;</span>mx:<span class="kw3">HTML</span> id=<span class="st0">&quot;html&quot;</span> <span class="kw3">width</span>=<span class="st0">&quot;100%&quot;</span> <span class="kw3">height</span>=<span class="st0">&quot;100%&quot;</span> paddingLeft=<span class="st0">&quot;20&quot;</span> paddingTop=<span class="st0">&quot;20&quot;</span><span class="sy0">/&gt;</span>
&nbsp;
<span class="sy0">&lt;/</span>mx:WindowedApplication<span class="sy0">&gt;</span></pre></div></div>

<p><em>No I don&#8217;t normally use mx:script tags, its a test case.</em></p>
<p>Eventually it malloc fails and crashes. This issue is Mac only and also occurs during a FileReference (or File) <a href="http://livedocs.adobe.com/labs/flex3/langref/flash/net/FileReference.html#upload()">upload</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://rel.me/2008/03/29/memory-usage-during-file-upload-in-air/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Socket output progress in AIR</title>
		<link>http://rel.me/2008/01/17/socket-output-progress-in-air/</link>
		<comments>http://rel.me/2008/01/17/socket-output-progress-in-air/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 19:22:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[socket]]></category>

		<guid isPermaLink="false">/2008/03/18/socket-output-progress-in-air</guid>
		<description><![CDATA[Currently when using the flash.net.Socket api, there is no way to determine that buffered data has been written to the socket. (The flush method is non-blocking and applies only to the actionscript socket buffer). This is a follow-up to a previous post. This issue does not arise when using the new File api (and writing [...]]]></description>
			<content:encoded><![CDATA[<p>Currently when using the flash.net.Socket api, there is no way to<br />
determine that buffered data has been written to the socket. (The flush method is non-blocking and applies only to the actionscript socket buffer).</p>
<p>This is a follow-up to a <a href="http://ducktyper.com/2007/12/27/flush">previous post</a>.</p>
<p>This issue does not arise when using the new File api (and writing to<br />
files), since an event has been included in<br />
<a href="http://livedocs.adobe.com/labs/flex3/langref/flash/filesystem/FileStream.html#eventSummary">flash.filesystem.FileStream: OutputProgressEvent.OUTPUT_PROGRESS</a>
</p>
<p>If this (or a similar) event could be added to the Socket api, it<br />
would allow us to:</p>
<ul>
<li>Send large amounts of data on a socket (without causing large memory<br />
usage as data buffers in memory).</li>
<li>Measure the current progress of data being sent on the socket.</li>
</ul>
<p>We came upon this limitation from using our <a href="http://code.google.com/p/as3httpclientlib/">AS3 http client library</a>, and trying to send large<br />
files as part of a multipart upload. However this issue would arise<br />
when sending any significant amounts of data on a socket. For example, an FTP or bittorrent client would be impossible.</p>
<p>This issue has been discussed in other places, but is probably more<br />
pressing now with the AIR releases.</p>
<ul>
<li><a href="http://tech.groups.yahoo.com/group/flexcoders/message/72018">Getting progress events on Socket *write* (not read)</a></li>
<li><a href="http://www.onflex.org/ted/2007/05/flexftp-ftp-client-in-flex-using.php">FlexFTP &#8211; FTP Client in Flex using flash.net.Socket</a> (see comment by mailboo)</li>
</ul>
<p><b>Update: </b><a href="https://bugs.adobe.com/jira/browse/FP-6">Vote on this bug (FP-6)</p>
]]></content:encoded>
			<wfw:commentRss>http://rel.me/2008/01/17/socket-output-progress-in-air/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>popen&#8217;ing</title>
		<link>http://rel.me/2007/11/07/popen-your-new-best-friend/</link>
		<comments>http://rel.me/2007/11/07/popen-your-new-best-friend/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 06:06:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Airake]]></category>
		<category><![CDATA[Rake]]></category>
		<category><![CDATA[process]]></category>

		<guid isPermaLink="false">/2007/11/08/popen-your-new-best-friend</guid>
		<description><![CDATA[I updated airake to work on windows (thanks Todd). Instead of using system (or %x), I am trying IO.popen: IO.popen&#40;@cmd&#41; do &#124;f&#124; @output = f.read @process = Process.waitpid2&#40;f.pid&#41;&#91;1&#93; end and in windows you&#8217;ll need to cmd.exe /c it: @cmd = RUBY_PLATFORM =~ /win32/ ? &#34;cmd.exe /c #{cmd}&#34; : cmd This thread was helpful and I [...]]]></description>
			<content:encoded><![CDATA[<p>I updated <a href="http://airake.rubyforge.org">airake</a> to work on windows (thanks <a href="http://rubyforge.org/tracker/index.php?func=detail&#038;aid=13976&#038;group_id=4337&#038;atid=16700">Todd</a>). Instead of using system (or %x), I am trying IO.popen:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span class="kw4">IO</span>.<span class="me1">popen</span><span class="br0">&#40;</span>@cmd<span class="br0">&#41;</span> <span class="kw1">do</span> <span class="sy0">|</span>f<span class="sy0">|</span>
  <span class="re1">@output</span> = f.<span class="me1">read</span>
  <span class="re1">@process</span> = <span class="kw4">Process</span>.<span class="me1">waitpid2</span><span class="br0">&#40;</span>f.<span class="me1">pid</span><span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>
<span class="kw1">end</span></pre></div></div>

<p>and in windows you&#8217;ll need to cmd.exe /c it:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span class="re1">@cmd</span> = RUBY_PLATFORM =~ <span class="sy0">/</span>win32<span class="sy0">/</span> ? <span class="st0">&quot;cmd.exe /c #{cmd}&quot;</span> : cmd</pre></div></div>

<p>This <a href="http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/a274d5d47feae95">thread</a> was helpful and I popened a new <a href="http://airake.rubyforge.org/svn/trunk/lib/airake/runner.rb">airake/runner.rb</a> version. The FCSH daemon still doesn&#8217;t work in windows yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://rel.me/2007/11/07/popen-your-new-best-friend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update: Google Reader AIR app</title>
		<link>http://rel.me/2007/10/31/update-google-reader-air-app/</link>
		<comments>http://rel.me/2007/10/31/update-google-reader-air-app/#comments</comments>
		<pubDate>Wed, 31 Oct 2007 06:12:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[google reader]]></category>

		<guid isPermaLink="false">/2007/11/08/update-google-reader-air-app</guid>
		<description><![CDATA[Download GReader-0_1_2.air I updated the app to work in Leopard. I have no idea why but using the url, http://www.google.com/reader/view, instead of http://reader.google.com fixed it. I think that might mean there is a redirect issue? I changed the dock icon unread count to just show the number in the top right. Also I added an [...]]]></description>
			<content:encoded><![CDATA[<p id="greader_air2" style="float: right;padding: 0 18px 0 18px; margin: 0">
Download <a href="http://browsair.s3.amazonaws.com/GReader-0_1_2.air">GReader-0_1_2.air</a>
</p>
<p>I updated the app to work in Leopard. I have no idea why but using the url, http://www.google.com/reader/view, instead of http://reader.google.com fixed it. I think that might mean there is a redirect issue? I changed the dock icon unread count to just show the number in the top right. Also I added an option to enable the <a href="http://www.hicksdesign.co.uk/journal/google-reader-theme">hicksdesign</a> google reader theme. I had to mess with it since apparently AIR webkit doesn&#8217;t support the css <a href="http://en.wikipedia.org/wiki/Data:_URI_scheme">data uri scheme</a>, which is annoying.</p>
<p><script type="text/javascript">
var flash = new SWFObject("/flash/badge.swf", "greader_air_swf2", 217, 180, "8", "#FFFFFF");
flash.addVariable("appname", "GReader");
flash.addVariable("appurl", "http://browsair.s3.amazonaws.com/GReader-0_1_2.air");
flash.addVariable("airversion", "1.0.M5");
flash.addVariable("buttoncolor", "CCCCCC");
flash.addVariable("messagecolor", "FFFFFF");
flash.addVariable("imageurl", "http://browsair.s3.amazonaws.com/GReader-0_1.png");
flash.write("greader_air2");
</script></p>
<p style="clear:both">I apply the style through the javascript bridge:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt>5<tt>
</tt>6<tt>
</tt>7<tt>
</tt>8<tt>
</tt>9<tt>
</tt><strong>10</strong><tt>
</tt>11<tt>
</tt>12<tt>
</tt>13<tt>
</tt>14<tt>
</tt>15<tt>
</tt>16<tt>
</tt>17<tt>
</tt>18<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">    [Embed(source=&quot;/assets/styles/greader/greader.css&quot;, mimeType=&quot;application/octet-stream&quot;)]<tt>
</tt>    private var cssClass:Class;<tt>
</tt><tt>
</tt>    private var html:HTML;<tt>
</tt>    ...<tt>
</tt><tt>
</tt>    public function applyStyle(e:Event):void {<tt>
</tt>      var cssByteArray:ByteArrayAsset = ByteArrayAsset(new cssClass());<tt>
</tt>      var css:String = cssByteArray.readUTFBytes(cssByteArray.length);<tt>
</tt>      <tt>
</tt>      var document:JavaScriptObject = html.htmlControl.window.document;<tt>
</tt>      <tt>
</tt>      var head:JavaScriptObject = document.getElementsByTagName(&quot;head&quot;)[0];<tt>
</tt>      var node:JavaScriptObject = document.createElement(&quot;style&quot;);<tt>
</tt>      node.type = &quot;text/css&quot;;<tt>
</tt>      node.appendChild(document.createTextNode(css));<tt>
</tt>      head.appendChild(node); <tt>
</tt>    }</pre>
</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://rel.me/2007/10/31/update-google-reader-air-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Reader AIR app</title>
		<link>http://rel.me/2007/10/29/google-reader-air-app/</link>
		<comments>http://rel.me/2007/10/29/google-reader-air-app/#comments</comments>
		<pubDate>Mon, 29 Oct 2007 04:18:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[dock]]></category>
		<category><![CDATA[google reader]]></category>
		<category><![CDATA[icon]]></category>

		<guid isPermaLink="false">/2008/01/01/google-reader-air-app</guid>
		<description><![CDATA[Download GReader-0_1.air I was playing around with the actionscript to javascript bridge and built this Google Reader AIR app: var flash = new SWFObject("/flash/badge.swf", "greader_air_swf", 217, 180, "8", "#FFFFFF"); flash.addVariable("appname", "GReader"); flash.addVariable("appurl", "http://browsair.s3.amazonaws.com/GReader-0_1.air"); flash.addVariable("airversion", "1.0.M5"); flash.addVariable("buttoncolor", "CCCCCC"); flash.addVariable("messagecolor", "FFFFFF"); flash.addVariable("imageurl", "http://browsair.s3.amazonaws.com/GReader-0_1.png"); flash.write("greader_air"); I find the unread count from &#8216;reading-list-unread-count&#8217;: 1 2 3 var html:HTML = [...]]]></description>
			<content:encoded><![CDATA[<p id="greader_air" style="float: right;padding: 0 18px 0 18px; margin: 0">
Download <a href="http://browsair.s3.amazonaws.com/GReader-0_1.air">GReader-0_1.air</a>
</p>
<p>I was playing around with the actionscript to javascript bridge and built this Google Reader AIR app:</p>
<p><script type="text/javascript">
var flash = new SWFObject("/flash/badge.swf", "greader_air_swf", 217, 180, "8", "#FFFFFF");
flash.addVariable("appname", "GReader");
flash.addVariable("appurl", "http://browsair.s3.amazonaws.com/GReader-0_1.air");
flash.addVariable("airversion", "1.0.M5");
flash.addVariable("buttoncolor", "CCCCCC");
flash.addVariable("messagecolor", "FFFFFF");
flash.addVariable("imageurl", "http://browsair.s3.amazonaws.com/GReader-0_1.png");
flash.write("greader_air");
</script></p>
<p style="clear:both">I find the unread count from &#8216;reading-list-unread-count&#8217;:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">var html:HTML = ...<tt>
</tt>var window:JavaScriptObject = html.htmlControl.window;<tt>
</tt>var unread:String = window.document.getElementById(&quot;reading-list-unread-count&quot;).innerHTML.toString();</pre>
</td>
</tr>
</table>
<p>Then I generate a dock icon (ignore all the hard coded pixel math): <br/><br />
<img src="http://ducktyper.com/assets/2007/10/29/GReader_dock_icon.png" style="float:none;padding: 5px 0 0 30px"/>
</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt>5<tt>
</tt>6<tt>
</tt>7<tt>
</tt>8<tt>
</tt>9<tt>
</tt><strong>10</strong><tt>
</tt>11<tt>
</tt>12<tt>
</tt>13<tt>
</tt>14<tt>
</tt>15<tt>
</tt>16<tt>
</tt>17<tt>
</tt>18<tt>
</tt>19<tt>
</tt><strong>20</strong><tt>
</tt>21<tt>
</tt>22<tt>
</tt>23<tt>
</tt>24<tt>
</tt>25<tt>
</tt>26<tt>
</tt>27<tt>
</tt>28<tt>
</tt>29<tt>
</tt><strong>30</strong><tt>
</tt>31<tt>
</tt>32<tt>
</tt>33<tt>
</tt>34<tt>
</tt>35<tt>
</tt>36<tt>
</tt>37<tt>
</tt>38<tt>
</tt>39<tt>
</tt><strong>40</strong><tt>
</tt>41<tt>
</tt>42<tt>
</tt>43<tt>
</tt>44<tt>
</tt>45<tt>
</tt>46<tt>
</tt>47<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">[Embed(source=&quot;/assets/app_icons/greader/icon_128.png&quot;)]<tt>
</tt>private var iconClass:Class;<tt>
</tt><tt>
</tt>[Embed(source=&quot;/assets/fonts/Verdana.ttf&quot;, fontName=&quot;GReaderDockIconFont&quot;, mimeType=&quot;application/x-font-truetype&quot;)]<tt>
</tt>private var fontClass:Class;<tt>
</tt>....<tt>
</tt><tt>
</tt>private function draw():void {  <tt>
</tt>  var icon:BitmapAsset = BitmapAsset(new iconClass()); <tt>
</tt>      <tt>
</tt>  var shape:Shape = new Shape();<tt>
</tt>  shape.graphics.beginBitmapFill(icon.bitmapData, new Matrix(), true, false);<tt>
</tt>  shape.graphics.drawRect(0, 0, dimensions, dimensions);<tt>
</tt>  shape.graphics.endFill();<tt>
</tt>  <tt>
</tt>  shape.graphics.beginFill(0xDF0013);<tt>
</tt>  shape.graphics.drawCircle(32, dimensions - 32, 32);<tt>
</tt>  shape.graphics.endFill();<tt>
</tt>  addChild(shape);<tt>
</tt>  <tt>
</tt>  if (unreadCount &gt; 0) addChild(buildText());      <tt>
</tt>}<tt>
</tt><tt>
</tt>public function buildText():Bitmap {<tt>
</tt>  var countText:TextField = new TextField();<tt>
</tt>  countText.embedFonts = true;<tt>
</tt><tt>
</tt>  var format:TextFormat = new TextFormat();<tt>
</tt>  format.font = new fontClass().fontName;<tt>
</tt>  format.color = 0xFFFFFF;      <tt>
</tt>  format.size = 26;<tt>
</tt>  format.align = TextFormatAlign.CENTER;<tt>
</tt>  <tt>
</tt>  countText.defaultTextFormat = format;<tt>
</tt>  countText.selectable = false;      <tt>
</tt>  countText.text = unreadCount.toString();<tt>
</tt>  countText.height = 32;<tt>
</tt>  countText.width = 54;<tt>
</tt>  <tt>
</tt>  var bitmapData:BitmapData = new BitmapData(64, 32, true, 0x00000000);<tt>
</tt>  bitmapData.draw(countText);      <tt>
</tt>  var bitmap:Bitmap = new Bitmap(bitmapData);<tt>
</tt>  bitmap.smoothing = true;<tt>
</tt>  bitmap.y = 128 - 52;<tt>
</tt>  bitmap.x = 4;<tt>
</tt>  return bitmap;<tt>
</tt>}</pre>
</td>
</tr>
</table>
<p>Set the dock icon with the generated bitmap data:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">if (Shell.shell.icon is InteractiveIcon) <tt>
</tt>  InteractiveIcon(Shell.shell.icon).bitmaps = icons;</pre>
</td>
</tr>
</table>
<p>For more info on dynamic dock icons, see <a href="http://weblogs.macromedia.com/cantrell/archives/2007/10/generating_dyna.cfm">Generating Dynamic Dock and System Tray Icons in AIR</a></p>
<p>I think the next step is taking a bunch of greasemonkey js scripts and adding them in. This might be how you would do that:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt>5<tt>
</tt>6<tt>
</tt>7<tt>
</tt>8<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">var html:HTML = ...<tt>
</tt>var window:JavaScriptObject = html.htmlControl.window;      <tt>
</tt>var head:JavaScriptObject = window.document.getElementsByTagName(&quot;head&quot;)[0];         <tt>
</tt>var script:JavaScriptObject = window.document.createElement('script');<tt>
</tt>script.type = 'text/javascript';<tt>
</tt>//script.src = 'http://lolcats.com/script.js';<tt>
</tt>script.innerHTML = &quot;alert('HAI.. KTHXBYE');&quot;;<tt>
</tt>head.appendChild(script);</pre>
</td>
</tr>
</table>
<p><strong>Update: </strong> I&#8217;ve seen it tack the CPU when interacting in a couple places so I will try to figure out if its AIR webkit being buggy or me. Also will fix the external link lameness at some point.</p>
<p><strong>Update: </strong> Oops. Looks like it doesn&#8217;t work in Leopard. </p>
]]></content:encoded>
			<wfw:commentRss>http://rel.me/2007/10/29/google-reader-air-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>browsair &#8211; Letting sites live in your dock</title>
		<link>http://rel.me/2007/10/13/browsair/</link>
		<comments>http://rel.me/2007/10/13/browsair/#comments</comments>
		<pubDate>Sat, 13 Oct 2007 22:28:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Airake]]></category>
		<category><![CDATA[browsair]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[google reader]]></category>

		<guid isPermaLink="false">/2007/11/08/browsair</guid>
		<description><![CDATA[I wrote an AIR project generator for airake called browsair. It will build you a AIR webkit browser app targeted at a web site, so you can let it live in you dock (or tray whatever), instead of that 4th tab on the 2nd firefox window. Theoretically someone could make a packaged browser + greasemonkey [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote an AIR project generator for <a href="http://airake.rubyforge.org">airake</a> called <a href="http://airake.rubyforge.org/browsair.html">browsair</a>. It will build you a AIR webkit browser app targeted at a web site, so you can let it live in you dock (or tray whatever), instead of that 4th tab on the 2nd firefox window.</p>
<p>Theoretically someone could make a packaged browser + greasemonkey + stylish AIR app for particular web sites that growl notifies and lives in the dock and be more in your face; but this scaffold right now is pretty basic.</p>
<p>I should also mention there is a website called <a href="http://airifier.com/">airifier</a> which does this as well, except I think they  give you a packaged app only, without the source.</p>
<p>I also got a bunch of fixes into this version of airake; packaging is fixed, and there is a task for creating certificates, among other things. I just deployed version 0.2.4 to rubyforge so it should be up by the time you read this.</p>
<p>The usage:</p>
<pre style="margin: 0 1em 1em 2em">browsair GReader http://reader.google.com path/to/rss_icon_128x128.png</pre>
<p>Creates an AIR project for a google reader AIR app. In the GReader project, run:</p>
<pre style="margin: 0 1em 1em 2em">rake air:package CERTIFICATE=path/to/cert.pfx</pre>
<p>If you need to generate a certificate:</p>
<pre style="margin: 0 1em 1em 2em">rake air:certificate CERTIFICATE=../ducktyper.pfx</pre>
<p>I built a couple already if you want to bypass all that compiling:</p>
<ul>
<li>Google Reader &#8211; <a href="http://browsair.s3.amazonaws.com/GReader.air">GReader.air</a></li>
<li>Facebook &#8211; <a href="http://browsair.s3.amazonaws.com/Facebook.air">Facebook.air</a></li>
</ul>
<p>(If you don&#8217;t have the AIR runtime installed, get it <a href="http://labs.adobe.com/downloads/air.html">here</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://rel.me/2007/10/13/browsair/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated airake to support AIR/Flex Beta 2</title>
		<link>http://rel.me/2007/10/05/updated-airake-to-support-air-flex-beta-2/</link>
		<comments>http://rel.me/2007/10/05/updated-airake-to-support-air-flex-beta-2/#comments</comments>
		<pubDate>Fri, 05 Oct 2007 05:06:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Airake]]></category>
		<category><![CDATA[Rake]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">/2007/11/08/updated-airake-to-support-air-flex-beta-2</guid>
		<description><![CDATA[I updated airake to support new AIR/Flex beta 2 build. sudo gem update airake I changed the fcsh tasks to: rake fcsh:start rake fcsh:stop rake fcsh:restart]]></description>
			<content:encoded><![CDATA[<p>I updated <a href="http://airake.rubyforge.org/">airake</a> to support new AIR/Flex beta 2 build.</p>
<pre style="margin:0pt 3em 1em 2em;">sudo gem update airake</pre>
<p>I changed the fcsh tasks to:</p>
<pre style="margin:0pt 3em 1em 2em;">rake fcsh:start
rake fcsh:stop
rake fcsh:restart
</pre>
]]></content:encoded>
			<wfw:commentRss>http://rel.me/2007/10/05/updated-airake-to-support-air-flex-beta-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>airake &#8211; Rake tasks and generators for adobe AIR apps</title>
		<link>http://rel.me/2007/09/11/airake-rake-tasks-and-generators-for-adobe-air-apps/</link>
		<comments>http://rel.me/2007/09/11/airake-rake-tasks-and-generators-for-adobe-air-apps/#comments</comments>
		<pubDate>Tue, 11 Sep 2007 03:03:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Airake]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Rake]]></category>
		<category><![CDATA[Rakefile]]></category>
		<category><![CDATA[tasks]]></category>

		<guid isPermaLink="false">/2007/11/08/airake-rake-tasks-and-generators-for-adobe-air-apps</guid>
		<description><![CDATA[airake gives you tasks for compiling, debugging, testing and packaging Adobe AIR applications. It also has a basic project generator/scaffold. All this was made possible because of the prolific newgem and rubigen gems. To get started, checkout airake.rubyforge.org The tasks and project might be a little Flex specific (cause of the particular project we are [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://airake.rubyforge.org">airake</a> gives you tasks for compiling, debugging, testing and packaging Adobe AIR applications. It also has a basic project generator/scaffold. All this was made possible because of the prolific <a href="http://newgem.rubyforge.org/">newgem</a> and <a href="http://rubigen.rubyforge.org/">rubigen</a> gems.</p>
<p>To get started, checkout <a href="http://airake.rubyforge.org">airake.rubyforge.org</a></p>
<p>The tasks and project might be a little Flex specific (cause of the particular project we are working on), so feel free to poke around or contribute back. Also I only tested it on MacOSX.</p>
<p>Some of the FCSH (flex compiler shell) daemon and wrappers are from the <a href="http://code.google.com/p/projectsprouts/">Sprout</a> project, so be sure to check them out.</p>
]]></content:encoded>
			<wfw:commentRss>http://rel.me/2007/09/11/airake-rake-tasks-and-generators-for-adobe-air-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
