<?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>formatlos &#187; AIR</title>
	<atom:link href="http://blog.formatlos.de/category/air/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.formatlos.de</link>
	<description>Martin Rädlinger</description>
	<lastBuildDate>Tue, 30 Mar 2010 18:35:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Digital Graffiti &#8211; Spray Demo</title>
		<link>http://blog.formatlos.de/2008/12/19/digital-graffiti-spray-demo/</link>
		<comments>http://blog.formatlos.de/2008/12/19/digital-graffiti-spray-demo/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 15:20:49 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[RFID]]></category>

		<guid isPermaLink="false">http://blog.formatlos.de/?p=285</guid>
		<description><![CDATA[

The canvas with the van is not very nice, but just  [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.formatlos.de/2008/12/19/digital-graffiti-spray-demo/"><em>Click here to view the embedded video.</em></a></p>
<p>The canvas with the van is not very nice, but just to show you a demo of the spray can. sorry for my bad spraying skills. see a description of the project <a href="http://blog.formatlos.de/2008/12/01/digital-graffiti/">here</a>.
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.formatlos.de%2F2008%2F12%2F19%2Fdigital-graffiti-spray-demo%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.formatlos.de%2F2008%2F12%2F19%2Fdigital-graffiti-spray-demo%2F&amp;source=formatlos&amp;style=normal&amp;hashtags=ActionScript,AIR,Arduino,AS3,Physical+Computing,RFID" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.formatlos.de/2008/12/19/digital-graffiti-spray-demo/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>BitmapData.draw() is limited to 4096px</title>
		<link>http://blog.formatlos.de/2008/12/11/bitmapdatadraw-is-limited-to-4096px/</link>
		<comments>http://blog.formatlos.de/2008/12/11/bitmapdatadraw-is-limited-to-4096px/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 11:25:45 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[BitmapData]]></category>

		<guid isPermaLink="false">http://blog.formatlos.de/?p=263</guid>
		<description><![CDATA[Thanks to Jens I figured out another limitation in the  [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to <a href="http://blog.jensfranke.com/" target="_blank">Jens</a> I figured out another limitation in the BitmapData class. It&#8217;s actually buried in the draw() method which doesn&#8217;t copy any pixels to the BitmapData object whose target x-/y-position is greater than 4096px (0&#215;1000). You don&#8217;t get any error just the pixels won&#8217;t be copied. This behavior is the same in FlashPlayer 9 and 10 and of course AIR 1.0 &#8211; 1.5.<br />
Actually this is no problem for the regular use of BitmapData in FP9 because the BitmapData size is limited to 2880&#215;2880px but using my BitmapDataUnlimited Class and trying to snapshot a Sprite wider or higher than 4096px won&#8217;t end up in your desired result.<br />
As you probably know Adobe changed the BitmapData limit in FP10 to a more flexible one, so you are not limited by a specific size anymore but a maximum pixel count of 16,777,215. This means that you can have a BitmapData up to 8191&#215;2048px without using BitmapDataUnlimited but interestingly you can&#8217;t draw a Sprite with the same size to this BitmapData object. I think Adobe forgot about their own secret, undocumented &raquo;feature&laquo;.
</p>
<p>
<strong>example</strong></p>
<div class="image img-a" style="width:560px;"><img src="http://blog.formatlos.de/wp-content/uploads/2008/12/sprite_original.png" alt="" title="Sprite"/>
<p>Sprite: w=8191, h=2048</p>
</div>
<div class="image img-a" style="width:560px;"><img src="http://blog.formatlos.de/wp-content/uploads/2008/12/sprite_snapshot.png" alt="" title="Snapshot"/>
<p> FP10 BitmapData: w=8191, h=2048 with snapshot of the Sprite</p>
</div>
<p>
<strong>workaround</strong></p>
<p>
A workaround for that problem would be to draw everything directly to the BitmapData or if you have to snapshot a Sprite greater than 4096px you could draw it to 4096px BitmapData chunks and copy them to the huge BitmapData afterwards using copyPixels().
</p>
<p>
<strong>Update December 14th, 2008</strong></p>
<p>
I added a draw method to the <a href="http://blog.formatlos.de/2008/05/28/bitmapdataunlimited/">BitmapDataUnlimited</a> class to bypass the 4096px limit.
</p>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.formatlos.de%2F2008%2F12%2F11%2Fbitmapdatadraw-is-limited-to-4096px%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.formatlos.de%2F2008%2F12%2F11%2Fbitmapdatadraw-is-limited-to-4096px%2F&amp;source=formatlos&amp;style=normal&amp;hashtags=ActionScript,AIR,AS3,BitmapData,Flash" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.formatlos.de/2008/12/11/bitmapdatadraw-is-limited-to-4096px/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Using RFID in an ActionScript Application</title>
		<link>http://blog.formatlos.de/2008/12/09/using-rfid-in-an-actionscript-application/</link>
		<comments>http://blog.formatlos.de/2008/12/09/using-rfid-in-an-actionscript-application/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 12:57:29 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[RFID]]></category>

		<guid isPermaLink="false">http://blog.formatlos.de/?p=241</guid>
		<description><![CDATA[
 In order to receive tags, the RFID reader has to be  [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.formatlos.de/2008/12/09/using-rfid-in-an-actionscript-application/"><em>Click here to view the embedded video.</em></a></p>
<p> In order to receive tags, the RFID reader has to be activated through a click on the image. After that, the different RFID tags (sorry for my tiny tags) are used to create different forms.
</p>
<p><span id="more-241"></span></p>
<p style="margin-top:50px;">
The <a href="http://blog.formatlos.de/2008/12/08/arduino-id-12/">previous post</a> was all about wiring the RFID reader ID-12 and an Arduino board. Now I want to show you how to use this setup within an ActionScript application. </p>
<p>As you don&#8217;t have the possibility to access the hardware respectively the usb/bluetooth serial port directly, you have to use a Socket server which redirects the network socket connections to or from the serial ports. Fortunately there are already ready-to-use solutions like <a href="http://freshmeat.net/projects/serproxy/" target="_blank">serproxy</a> or TinkerProxy (<a href="http://tinker.it/now/wp-content/uploads/2007/06/tinkerproxy.zip">win</a>, <a href="http://tinker.it/now/wp-content/uploads/2007/05/tinkerproxy_mac.zip">osx</a>) available. Personally I prefer serproxy, but if you want to have a nice GUI I would recommend TinkerProxy.<br />
These proxy servers are not made specifically for the use with Flash and therefore they don&#8217;t implement a cross-domain-policy file. As you probably know this is needed for not getting a security error in your flash application. As a workaround for that problem you can get <a href="http://www.blog.lessrain.com/downloads/policyserver.jar" target="_blank">lessrains policyserver</a> and start it on port 5334 (java -jar policyserver.jar 5334). It will return an appropriate policy file when requested by the flash application.</p>
<p>
With these things in mind we can go for some code now.
</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">...
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">connect</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>_state <span style="color: #66cc66;">!</span>= DISCONNECTED<span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span>;
	_state = CONNECTING;
&nbsp;
	addSocketEvents<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">// load policy file from localhost, port 5334</span>
	Security.<span style="color: #006600;">loadPolicyFile</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;xmlsocket://&quot;</span> + SOCKET_HOST + <span style="color: #ff0000;">&quot;:&quot;</span> + <span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#40;</span>POLICY_PORT<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #808080; font-style: italic;">// connect to proxy localhost, port 5333</span>
	_socket.<span style="color: #0066CC;">connect</span><span style="color: #66cc66;">&#40;</span>SOCKET_HOST, PROXY_PORT<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> disconnect<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>_state <span style="color: #66cc66;">!</span>= CONNECTED<span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span>;
	_state = DISCONNECTING;
&nbsp;
	sendDisconnect<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	processDisconnect<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> finalize<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	...
<span style="color: #66cc66;">&#125;</span>
...</pre></div></div>

<p>My RFID class implements basically 3 public methods + the EventDispatcher stuff.
</p>
<p style="margin-top:40px;">

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">...
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> connectSocket<span style="color: #66cc66;">&#40;</span>event : Event<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> 
<span style="color: #66cc66;">&#123;</span>   
	<span style="color: #808080; font-style: italic;">// send ping to arduino</span>
	_pingTimer = <span style="color: #000000; font-weight: bold;">new</span> Timer<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
	_pingTimer.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>TimerEvent.<span style="color: #006600;">TIMER</span>, handleTimer<span style="color: #66cc66;">&#41;</span>;
	_pingTimer.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> handleTimer<span style="color: #66cc66;">&#40;</span>event : TimerEvent<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	sendPing<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
...</pre></div></div>

<p>The Socket class dispatches Event.CONNECT when the connection to the proxy server is established but that doesn&#8217;t mean that the hardware is connected as well. To really know when the arduino is listening I use a timer to send a ping to the Arduino board. When I get the ping back, I know that the Arduino is ready to use.
</p>
<p style="margin-top:40px;">

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">...
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> processRfidTag<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	_cachePosition = _cache.<span style="color: #0066CC;">position</span> - <span style="color: #cc66cc;">1</span>;
	<span style="color: #000000; font-weight: bold;">var</span> bytesIn : <span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>;
	<span style="color: #000000; font-weight: bold;">var</span> val : <span style="color: #0066CC;">int</span>;
	<span style="color: #000000; font-weight: bold;">var</span> rfidTag : <span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;&quot;</span>;
&nbsp;
	<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>_cache.<span style="color: #006600;">bytesAvailable</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">&amp;&amp;</span> bytesIn <span style="color: #66cc66;">&lt;</span> <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span> 
	<span style="color: #66cc66;">&#123;</span>                        				
		val = _cache.<span style="color: #006600;">readByte</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">// if ETX or STX before the 10 digit reading -&gt; stop reading</span>
		<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>val == STX<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">||</span> <span style="color: #66cc66;">&#40;</span>val == ETX<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">break</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">// Do Ascii/Hex conversion:</span>
		<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>val <span style="color: #66cc66;">&gt;</span>= 0x30<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: #66cc66;">&#40;</span>val <span style="color: #66cc66;">&lt;</span> = 0x39<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> 
			val -= 0x30;
		<span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>val <span style="color: #66cc66;">&gt;</span>= 0x41<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: #66cc66;">&#40;</span>val <span style="color: #66cc66;">&lt;</span> = 0x46<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
			val = <span style="color: #cc66cc;">10</span> + val - 0x41;
&nbsp;
		rfidTag += val.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">16</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">toUpperCase</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">// ready to read next digit</span>
		bytesIn++;                                
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">// read complete</span>
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>bytesIn == <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span> 
	<span style="color: #66cc66;">&#123;</span> 
		<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>rfidTag <span style="color: #66cc66;">!</span>= <span style="color: #ff0000;">&quot;0000000000&quot;</span> <span style="color: #66cc66;">&#41;</span> _tag = rfidTag;
		<span style="color: #b1b100;">else</span> _tag = <span style="color: #000000; font-weight: bold;">null</span>;
&nbsp;
		_cachePosition = -<span style="color: #cc66cc;">1</span>;
		dispatchEvent<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> RFIDEvent<span style="color: #66cc66;">&#40;</span>RFIDEvent.<span style="color: #006600;">TAG_CHANGED</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
...</pre></div></div>

<p>When I receive some data from the socket, I look for the STX byte which is the header or marker of the RFID tag and get the tag via processRfidTag(). Beyond that I don&#8217;t read the bytes directly from the socket but write all the incoming data in a cache first to not loose any information coming in in different ProgressEvent.SOCKET_DATA events.
</pre>
</p>
<p>
<a href="http://blog.formatlos.de/wp-content/uploads/2008/12/id-12_demo.zip">Download the full source of my ID-12 demo</a> and don't forget to replace my tag ids with yours otherwise your RFID tags won't draw any form.
</p>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.formatlos.de%2F2008%2F12%2F09%2Fusing-rfid-in-an-actionscript-application%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.formatlos.de%2F2008%2F12%2F09%2Fusing-rfid-in-an-actionscript-application%2F&amp;source=formatlos&amp;style=normal&amp;hashtags=ActionScript,AIR,AS3,Flash,Physical+Computing,RFID" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.formatlos.de/2008/12/09/using-rfid-in-an-actionscript-application/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Digital Graffiti &#8211; A Subculture Conquers Interactive Worlds</title>
		<link>http://blog.formatlos.de/2008/12/01/digital-graffiti/</link>
		<comments>http://blog.formatlos.de/2008/12/01/digital-graffiti/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 09:28:04 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[RFID]]></category>

		<guid isPermaLink="false">http://blog.formatlos.de/?p=185</guid>
		<description><![CDATA[Finally I delivered my thesis project I did in cooperat [...]]]></description>
			<content:encoded><![CDATA[<p>Finally I delivered my thesis project I did in cooperation with <a href="http://www.lessrain.com" target="_blank">Less Rain</a>. The subject was &raquo;Digital Graffiti &#8211; A Subculture Conquers Interactive Worlds&laquo; and it&#8217;s all about experimenting with different input devices for a physical, digital graffiti installation. The result is an Adobe AIR application using either the computer mouse, the Nintendo Wiimote or &raquo;VandalSpray&laquo; to paint digital canvases. VandalSpray is a digital spray can specifically designed for this purpose. It implements the attributes of a real spray can or at least trys to achieve them as natural as possible. Except a turnable bottom for changing the color, VandalSpray has no other interfacing elements than its real counterpart and therefore you don&#8217;t have to learn and explore the functionality first, because you intuitively know how to use it.</p>
<p>
<strong>VandalSpray features includes:</strong>
</p>
<ul>
<li>exchangeable caps</li>
<li>color display</li>
<li>digital valve system to vary the amount of &raquo;paint&laquo; coming out of the cap</li>
<li>different colors</li>
<li>wireless</li>
</ul>
<p>
The spray can is built upon the <a href="http://www.arduino.cc/" target="_blank">Arduino</a> platform and uses different sensors and electronic modules like a RFID reader, a super bright RGB LED, a Rotary Encoder, a Bluetooth module, a force sensitive resitor (FSR) and loads of wires and solder to implement the desired behavior. For tracking the spray can I use a Wiimote and the <a href="http://www.wiiflash.org" target="_blank">WiiFlash</a> ActionScript 3 library and server, but this could also be replaced by a standard webcam and an adequate tracking implementation.<br />
Because I didn&#8217;t want to put some kind of speaker in the spray can (there was no space left anyway) the spray sound is generated from the AIR app and output on the speakers of the notebook.
</p>
<p><div class="image img-a" style="width:560px;"><img src="http://blog.formatlos.de/wp-content/uploads/2008/12/vandalspray_1.jpg" alt="" title="VandalSpray vs. Montana spray can"/>
<p>VandalSpray vs. Montana spray can</p>
</div>
<div class="image img-a" style="width:560px;"><img src="http://blog.formatlos.de/wp-content/uploads/2008/12/vandalspray_2.jpg" alt="" title="VandalSpray electronics"/>
<p>VandalSpray electronics</p>
</div>
<p><strong>More</strong><br />
<a href="http://blog.formatlos.de/2008/12/12/digital-spraycan-edemo/">http://blog.formatlos.de/2008/12/12/digital-spraycan-edemo/</a><br />
<a href="http://blog.formatlos.de/2008/12/19/digital-graffiti-spray-demo/">http://blog.formatlos.de/2008/12/19/digital-graffiti-spray-demo/</a></p>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.formatlos.de%2F2008%2F12%2F01%2Fdigital-graffiti%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.formatlos.de%2F2008%2F12%2F01%2Fdigital-graffiti%2F&amp;source=formatlos&amp;style=normal&amp;hashtags=ActionScript,AIR,Arduino,AS3,Physical+Computing,RFID" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.formatlos.de/2008/12/01/digital-graffiti/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>FlashPlayer 10 and loading AVM1 content</title>
		<link>http://blog.formatlos.de/2008/11/20/flashplayer-10-and-loading-avm1-content/</link>
		<comments>http://blog.formatlos.de/2008/11/20/flashplayer-10-and-loading-avm1-content/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 09:28:43 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[AS3]]></category>

		<guid isPermaLink="false">http://blog.formatlos.de/?p=176</guid>
		<description><![CDATA[I'm using some swf assets directly exported from Illust [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using some swf assets directly exported from Illustrator CS3. You can export Flash 9 swfs, but as you can&#8217;t add any code there you will always get AVM1 content (AS2.0). So it&#8217;s basically just an information in the header and maybe Adobe will put an option in the export-settings to actually publish AVM2 swfs. I haven&#8217;t tried CS4 so far, maybe it&#8217;s in there already?!<br />
Anyway, loading this swfs and moving it to another part of the displayList didn&#8217;t cause any problems using FlashPlayer 9. In FlashPlayer 10 I get the runtime error 2180:</p>
<p><strong>Error #2180: It is illegal to move AVM1 content (AS1 or AS2) to a different part of the displayList when it has been loaded into AVM2 (AS3) content.</strong></p>
<p>There are a few options to avoid this error:</p>
<ul>
<li>Don&#8217;t load AVM1 content respectively create the assets in Flash to get AVM2 swfs</li>
<li>Don&#8217;t move the assets in a different part of the displayList</li>
<li>Change the SWF header on-the-fly</li>
</ul>
<p>
The last solution seemed to be perfect and remembering the AVM2Loader class someone created in the upcoming AS3 times it was the easiest solution without changing the workflow. Even if the author <a href="http://www.fladdict.net/blog-en/2007/06/avm2loader_class.html" target="_blank">Fladdict</a> removed the class, you can still find it on the internet at <a href="http://troyworks.com/blog/2007/09/17/avm2loader-converting-avm1-to-avm2/" target="_blank">Troy Gardners</a> blog.
</p>
<p><strong>Update 20.11.2008</strong></p>
<p>To use this workaround in an AIR application you have to set allowLoadBytesCodeExecution = true in your LoaderContext otherwise you aren&#8217;t allowed to load the bytes of the swf.</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">...
<span style="color: #000000; font-weight: bold;">var</span> loader:Loader = <span style="color: #000000; font-weight: bold;">new</span> AVM2Loader<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> loaderContext:LoaderContext = <span style="color: #000000; font-weight: bold;">new</span> LoaderContext<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
loaderContext.<span style="color: #006600;">allowLoadBytesCodeExecution</span> = <span style="color: #000000; font-weight: bold;">true</span>;
loader.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;file.swf&quot;</span>, loaderContext<span style="color: #66cc66;">&#41;</span>;
...</pre></div></div>

</p>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.formatlos.de%2F2008%2F11%2F20%2Fflashplayer-10-and-loading-avm1-content%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.formatlos.de%2F2008%2F11%2F20%2Fflashplayer-10-and-loading-avm1-content%2F&amp;source=formatlos&amp;style=normal&amp;hashtags=AIR,AS3,Flash" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.formatlos.de/2008/11/20/flashplayer-10-and-loading-avm1-content/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Compiling AIR or what is the right SDK</title>
		<link>http://blog.formatlos.de/2008/11/17/what-is-the-right-sdk/</link>
		<comments>http://blog.formatlos.de/2008/11/17/what-is-the-right-sdk/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 09:14:29 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[AIR]]></category>

		<guid isPermaLink="false">http://blog.formatlos.de/?p=169</guid>
		<description><![CDATA[This is no tutorial about creating ant build files and  [...]]]></description>
			<content:encoded><![CDATA[<p>This is no tutorial about creating ant build files and so on. you can find a good one with a sample project at the <a href="http://fdt.powerflasher.com/blog/?p=10" target="_blank">FDT blog</a>. It&#8217;s for AIR 1.0 but you just have to change the descriptor xml to the new format and it should work.
</p>
<p>
This post is all about using the right SDK. With the release of AIR 1.5 some of you might switch and run into the same problems I did when I set up my first AIR project. Compiling for AIR is a little bit more strict and bound to the SDK than compiling for FlashPlayer. If you want to target for instance FlashPlayer 9 you could use Flex SDK 3.0, 3.2 or even a beta release of Gumbo (4.0), as long as you don&#8217;t use any of the classes or functions that are related with FlashPlayer 10 (e.g. the Vector class).<br />
Compiling for AIR is a little bit different. The SDK is more or less bound to the version you want to target, so you have to use the right SDK in combination with the right definition in the application descriptor file.
</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;application</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://ns.adobe.com/air/application/1.1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
...
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/application<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

</p>
<p>
As you can see this descriptor is for AIR 1.1. If you try to compile with the SDK 3.2 which targets AIR 1.5 you will get a compile error (&#8220;error while loading initial content&#8221;). </p>
<p>Just keep that in mind and use the right SDK:</p>
<ul>
<li>AIR 1.0 &#8211; Flex SDK 3.0</li>
<li>AIR 1.1 &#8211; Flex SDK 3.1</li>
<li>AIR 1.5 &#8211; Flex SDK 3.2</li>
</ul>
<p>
You can find a list of milestone releases, stable and nigthly builds at the <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3" target="_blank">Adobe Open Source site</a>.
</p>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.formatlos.de%2F2008%2F11%2F17%2Fwhat-is-the-right-sdk%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.formatlos.de%2F2008%2F11%2F17%2Fwhat-is-the-right-sdk%2F&amp;source=formatlos&amp;style=normal&amp;hashtags=AIR" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.formatlos.de/2008/11/17/what-is-the-right-sdk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AIR 1.1 &#8211; hiding the mouse cursor</title>
		<link>http://blog.formatlos.de/2008/11/16/air-hiding-the-mouse/</link>
		<comments>http://blog.formatlos.de/2008/11/16/air-hiding-the-mouse/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 16:51:13 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AIR 1.1]]></category>
		<category><![CDATA[AS3]]></category>

		<guid isPermaLink="false">http://blog.formatlos.de/?p=161</guid>
		<description><![CDATA[Adobe AIR is out quite a while now and you might think  [...]]]></description>
			<content:encoded><![CDATA[<p>Adobe AIR is out quite a while now and you might think that 	at least all the functions being in the FlashPlayer for years are implemented correctly. Obviously this is only wishful thinking because I wasn&#8217;t able to hide my mouse cursor through Mouse.hide() even though the <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/ui/Mouse.html#hide()">documentation</a> says that it&#8217;s possible. I couldn&#8217;t reproduce the same thing on Windows so I guess it&#8217;s only a problem on OSX and maybe Linux (but who really cares about linux?). After investigating quite a while I found out that the cursor disappears after moving it out of the window and back in or switch to another application and back but you can&#8217;t tell the user &quot;please move your cursor out of the window and back in&quot; or at least it&#8217;s not very nice and user-friendly. I tried every possible setting for the native window and finally found a workaround &#8230; wohoo.
</p>
<p>Try the following in your document class and your cursor is gone, hopefully!</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">stage</span>.<span style="color: #006600;">nativeWindow</span>.<span style="color: #006600;">activate</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">nativeWindow</span>.<span style="color: #006600;">orderToBack</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">nativeWindow</span>.<span style="color: #006600;">orderToFront</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">Mouse</span>.<span style="color: #0066CC;">hide</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

</p>
<p>
Basically this sends the window behind all the other windows and brings it to the front again immediately. You won&#8217;t see the change or any flickering. After that you can hide your cursor. </p>
<p><strong>Update 17.11.2008</strong></p>
<p>Adobe just released AIR 1.5 but seems like this problem is still there. The workaround is still working so keep on rockin&#8217; or should I say hiding</p>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.formatlos.de%2F2008%2F11%2F16%2Fair-hiding-the-mouse%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.formatlos.de%2F2008%2F11%2F16%2Fair-hiding-the-mouse%2F&amp;source=formatlos&amp;style=normal&amp;hashtags=AIR+1.1,AS3" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.formatlos.de/2008/11/16/air-hiding-the-mouse/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>AIR 1.1 &#8211; Maximized Window at Startup</title>
		<link>http://blog.formatlos.de/2008/11/16/air-11-maximized-window-at-startup/</link>
		<comments>http://blog.formatlos.de/2008/11/16/air-11-maximized-window-at-startup/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 16:08:37 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AIR 1.1]]></category>
		<category><![CDATA[AS3]]></category>

		<guid isPermaLink="false">http://blog.formatlos.de/?p=154</guid>
		<description><![CDATA[There are a lot of settings for the initial window in t [...]]]></description>
			<content:encoded><![CDATA[<p>There are a lot of settings for the initial window in the application descriptor file but none for getting a maximized window at startup. To achieve that you have to call stage.nativeWindow.maximize() in your Document Class. This works fine but you&#8217;ll actually see the small window being maximized and this isn&#8217;t very cool. To avoid this you can set visible = false for the initial window in the descriptor file and show the window after maximizing it but take into account that the maximize() method is asynchronous and therefore setting stage.nativeWindow.visible = true right after the call won&#8217;t change anything. Use the NativeWindowBoundsEvent.RESIZE event to determine when your window size has changed.
</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">...
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Main<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">nativeWindow</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>NativeWindowBoundsEvent.<span style="color: #006600;">RESIZE</span>, resize<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">nativeWindow</span>.<span style="color: #006600;">maximize</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;				
<span style="color: #66cc66;">&#125;</span>
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> resize<span style="color: #66cc66;">&#40;</span>event : NativeWindowBoundsEvent<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">// show window + set keyboard and mouse focus</span>
	<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">nativeWindow</span>.<span style="color: #006600;">activate</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
...</pre></div></div>

</p>
<p>
Apparently this works on OSX but not on Windows. There the window has to be visible in order to maximize it. I didn&#8217;t do many tests so prove me wrong if you have other experiences.</p>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.formatlos.de%2F2008%2F11%2F16%2Fair-11-maximized-window-at-startup%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.formatlos.de%2F2008%2F11%2F16%2Fair-11-maximized-window-at-startup%2F&amp;source=formatlos&amp;style=normal&amp;hashtags=AIR+1.1,AS3" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.formatlos.de/2008/11/16/air-11-maximized-window-at-startup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
