<?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>Aboutme - blog &#187; Uncategorized</title>
	<atom:link href="http://blog.aboutme.be/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.aboutme.be</link>
	<description></description>
	<lastBuildDate>Fri, 13 Jan 2012 08:58:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Access the mac sudden motion sensor with an AIR native extension</title>
		<link>http://blog.aboutme.be/2012/01/13/access-the-mac-sudden-motion-sensor-with-an-air-native-extension/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=access-the-mac-sudden-motion-sensor-with-an-air-native-extension</link>
		<comments>http://blog.aboutme.be/2012/01/13/access-the-mac-sudden-motion-sensor-with-an-air-native-extension/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 08:58:36 +0000</pubDate>
		<dc:creator>wouter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[native extension]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[sudden motion sensor]]></category>

		<guid isPermaLink="false">http://blog.aboutme.be/?p=293</guid>
		<description><![CDATA[AIR on mobile enables you to access the accelerometer of the mobile device. But what about the motion sensor in your macbook / macbook pro computer on the desktop? All macbooks come with a &#8220;sudden motion sensor&#8221;, which shuts down the hard disk when the laptop moves too much. I wrote an AIR native extension, [...]]]></description>
			<content:encoded><![CDATA[<p>AIR on mobile enables you to access the accelerometer of the mobile device. But what about the motion sensor in your macbook / macbook pro computer on the desktop? All macbooks come with a &#8220;sudden motion sensor&#8221;, which shuts down the hard disk when the laptop moves too much.</p>
<p>I wrote an AIR native extension, to access this sensor information in AIR on OSX. I tried to mimic the Accelerometer API as much as possible, and make it easy to use in your AIR application.</p>
<p><iframe src="http://player.vimeo.com/video/34998777?title=0&amp;byline=0&amp;portrait=0" width="500" height="282" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
<p>You can check if the SuddenMotionSensor is supported on your mac, set the update interval and listen for accelerometer events:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>SuddenMotionSensor.<span style="color: #006600;">isSupported</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	suddenMotionSensor = <span style="color: #000000; font-weight: bold;">new</span> SuddenMotionSensor<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	suddenMotionSensor.<span style="color: #006600;">setRequestedUpdateInterval</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span>;
	suddenMotionSensor.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>AccelerometerEvent.<span style="color: #006600;">UPDATE</span>, accelerometerUpdateHandler, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>You can then access the accelerometer info in the event handler:</p>

<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> accelerometerUpdateHandler<span style="color: #66cc66;">&#40;</span>event:AccelerometerEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">accelerationX</span>, event.<span style="color: #006600;">accelerationY</span>, event.<span style="color: #006600;">accelerationZ</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><a href="http://labs.aboutme.be/native_extensions/suddenmotionsensor/suddenmotionsensor_0.1.zip" title="Sudden Motion Sensor Sources &#038; Demos">Download the sources &#038; demos here</a>, and have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aboutme.be/2012/01/13/access-the-mac-sudden-motion-sensor-with-an-air-native-extension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing the kinect in javascript through websockets</title>
		<link>http://blog.aboutme.be/2012/01/07/accessing-the-kinect-in-javascript-through-websockets/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=accessing-the-kinect-in-javascript-through-websockets</link>
		<comments>http://blog.aboutme.be/2012/01/07/accessing-the-kinect-in-javascript-through-websockets/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 07:14:23 +0000</pubDate>
		<dc:creator>wouter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[airkinect]]></category>
		<category><![CDATA[AIRServer]]></category>
		<category><![CDATA[as3nui]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[kinect]]></category>
		<category><![CDATA[threejs]]></category>

		<guid isPermaLink="false">http://blog.aboutme.be/?p=288</guid>
		<description><![CDATA[Good morning all! (or evening, night, &#8230; depending on when you read this post of course). As you might know, I&#8217;ve been working on AIRKinect (as3nui.com) and I&#8217;ve got a side project AIRServer aswell (which allows you to setup air as a socket server, including websocket support). Wouldn&#8217;t it be fun, to combine these two [...]]]></description>
			<content:encoded><![CDATA[<p>Good morning all! (or evening, night, &#8230; depending on when you read this post of course). As you might know, I&#8217;ve been working on AIRKinect (<a href="http://www.as3nui.com" target="_blank">as3nui.com</a>) and I&#8217;ve got a side project AIRServer aswell (which allows you to setup air as a socket server, including websocket support).</p>
<p>Wouldn&#8217;t it be fun, to combine these two projects in a demo, so you can access the kinect information through a websocket? That&#8217;s exactly what I did. You run a desktop application on your computer, which is responsible for accessing the kinect, and exposing the skeleton information over a websocket. Using a javascript client, which supports websockets, you can connect to that server, and use the skeleton information in the javascript client :-)</p>
<p><img src="http://blog.aboutme.be/wp-content/uploads/2012/01/airkinect-socket-server-0.1.png" alt="" title="javascript displaying kinect skeleton information" width="500" height="481" class="aligncenter size-full wp-image-289" /></p>
<p>In this demo, I&#8217;m just rendering the skeleton points in a canvas element, using three.js.</p>
<p>I&#8217;ve <a href="http://labs.aboutme.be/airserver/airkinect-socket-server-0.1.zip" title="Download the sources &#038; binaries for the airkinect websocket server">uploaded the sources and included binary installers</a> for the desktop application (windows 7, OSX Lion). What you&#8217;ll need to do is install &#038; launch the desktop application, and click on the &#8220;start server&#8221; button to listen for websocket connections on the given port. Make sure you&#8217;ve got the kinect sdk installed on your computer (windows) or openni on OSX.</p>
<p>Using the <a href="http://labs.aboutme.be/airserver/kinect/" target="_blank">javascript client</a>, you connect to your ip (if you&#8217;re testing on the same ip, 127.0.0.1 should be fine), and you can start dancing in the canvas element :-).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aboutme.be/2012/01/07/accessing-the-kinect-in-javascript-through-websockets/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AIRServer 0.5 &#8211; socket byte concatenation</title>
		<link>http://blog.aboutme.be/2011/12/23/airserver-0-5-socket-byte-concatenation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=airserver-0-5-socket-byte-concatenation</link>
		<comments>http://blog.aboutme.be/2011/12/23/airserver-0-5-socket-byte-concatenation/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 16:54:34 +0000</pubDate>
		<dc:creator>wouter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[AIRServer]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[P2P]]></category>
		<category><![CDATA[sockets]]></category>
		<category><![CDATA[websockets]]></category>

		<guid isPermaLink="false">http://blog.aboutme.be/?p=280</guid>
		<description><![CDATA[I&#8217;ve just finished work on a little update of my AIRServer library (version 0.5, hooray!). Apparently, when you send large chunks of data over the socket (like sending an image to the server, over the socket), it could happen the data is split over multiple packages. This caused errors on the server side. I&#8217;ve fixed [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just finished work on a little update of my AIRServer library (version 0.5, hooray!). Apparently, when you send large chunks of data over the socket (like sending an image to the server, over the socket), it could happen the data is split over multiple packages. This caused errors on the server side.</p>
<p>I&#8217;ve fixed that issue, and uploaded an <a href="http://labs.aboutme.be/airserver/airserver-0.5.zip">updated version, together with an image-sending-demo</a>. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aboutme.be/2011/12/23/airserver-0-5-socket-byte-concatenation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>AIRServer 0.4 &#8211; UDP Handling, Chrome 16 websockets &amp; bugfixes</title>
		<link>http://blog.aboutme.be/2011/12/15/airserver-0-4-udp-handling-chrome-16-websockets-bugfixes/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=airserver-0-4-udp-handling-chrome-16-websockets-bugfixes</link>
		<comments>http://blog.aboutme.be/2011/12/15/airserver-0-4-udp-handling-chrome-16-websockets-bugfixes/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 09:38:53 +0000</pubDate>
		<dc:creator>wouter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[AIRServer]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[P2P]]></category>
		<category><![CDATA[sockets]]></category>
		<category><![CDATA[websockets]]></category>

		<guid isPermaLink="false">http://blog.aboutme.be/?p=273</guid>
		<description><![CDATA[I&#8217;ve just finished some updates on my AIRServer library, which enables you to create an AIR app that listens for different inputs such as sockets, websockets and P2P traffic. This gives you the option to create a multi-user game, with different input controllers. I&#8217;ve added a UDP Endpoint, so you can handle UDP traffic aswell [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just finished some updates on my AIRServer library, which enables you to create an AIR app that listens for different inputs such as sockets, websockets and P2P traffic. This gives you the option to create a multi-user game, with different input controllers.</p>
<p><img src="http://blog.aboutme.be/wp-content/uploads/2011/12/Screen-Shot-2011-12-15-at-09.43.png" alt="" title="AIRServer handles multiple inputs" width="500" height="416" class="aligncenter size-full wp-image-276" /></p>
<p>I&#8217;ve added a UDP Endpoint, so you can handle UDP traffic aswell now (<a href="http://blog.aboutme.be/2011/12/14/udp-native-extension-for-air-mobile-now-with-android-support/">check out the UDP native extension for AIR mobile, to use UDP on mobile devices</a>). UDP is connectionless, so you can specify a timeout, when we mark a &#8220;udp client&#8221; as disconnected.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">server.<span style="color: #006600;">addEndPoint</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> UDPEndPoint<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1236</span>, <span style="color: #000000; font-weight: bold;">new</span> NativeObjectSerializer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;">60000</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>When you want to send data back over UDP, you&#8217;ll need to know the UDP listening port of the client: therefore, the client can send a &#8220;PORT&#8221; command, with the listening port as data argument:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">protected <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>
	listeningSocket = <span style="color: #000000; font-weight: bold;">new</span> DatagramSocket<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	listeningSocket.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>DatagramSocketDataEvent.<span style="color: #0066CC;">DATA</span>, socketDataHandler<span style="color: #66cc66;">&#41;</span>;
	listeningSocket.<span style="color: #006600;">bind</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">9876</span><span style="color: #66cc66;">&#41;</span>;
	listeningSocket.<span style="color: #006600;">receive</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	sendingSocket = <span style="color: #000000; font-weight: bold;">new</span> DatagramSocket<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	sendingSocket.<span style="color: #0066CC;">connect</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;127.0.0.1&quot;</span>, <span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span>port.<span style="color: #0066CC;">text</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	currentState = <span style="color: #ff0000;">&quot;connected&quot;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
protected <span style="color: #000000; font-weight: bold;">function</span> sendInput<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	sendObject<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>command: <span style="color: #ff0000;">&quot;PORT&quot;</span>, <span style="color: #0066CC;">data</span>: listeningSocket.<span style="color: #006600;">localPort</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
	sendObject<span style="color: #66cc66;">&#40;</span>inputField.<span style="color: #0066CC;">text</span><span style="color: #66cc66;">&#41;</span>;
	inputField.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;&quot;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
protected <span style="color: #000000; font-weight: bold;">function</span> sendObject<span style="color: #66cc66;">&#40;</span>o:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> bytes:ByteArray = <span style="color: #000000; font-weight: bold;">new</span> ByteArray<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	bytes.<span style="color: #006600;">writeObject</span><span style="color: #66cc66;">&#40;</span>o<span style="color: #66cc66;">&#41;</span>;
	sendingSocket.<span style="color: #0066CC;">send</span><span style="color: #66cc66;">&#40;</span>bytes<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>I&#8217;ve also made some arguments optional (such as the message serializers). By default, an AMF endpoint will use a NativeObjectSerializer, websockets will use the JSONSerializer.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">server.<span style="color: #006600;">addEndPoint</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> SocketEndPoint<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1234</span>, <span style="color: #000000; font-weight: bold;">new</span> AMFSocketClientHandlerFactory<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
server.<span style="color: #006600;">addEndPoint</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> SocketEndPoint<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1235</span>, <span style="color: #000000; font-weight: bold;">new</span> WebSocketClientHandlerFactory<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
server.<span style="color: #006600;">addEndPoint</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> UDPEndPoint<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1236</span>, <span style="color: #000000; font-weight: bold;">new</span> NativeObjectSerializer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;">60000</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
server.<span style="color: #006600;">addEndPoint</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> CocoonP2PEndPoint<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;be.aboutme.airserver.demos.Messages&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>I&#8217;ve fixed some issues with multiple-messages in one packet. This was especially a problem with the websocket listener. The object serializer is now responsible for splitting the input into multiple messages (when necessary). By default, the JSONSerializer used for the websockets, will split messages on the newline (\n) character. Make sure you terminate each message you send from the client with this character, and you should be good to go.</p>
<p><del datetime="2011-12-23T16:56:07+00:00"><a href="http://labs.aboutme.be/airserver/airserver-0.4.zip">As always, you can download the sources &#038; updated demos to play with</a>. Happy coding!</del></p>
<p><a href="http://blog.aboutme.be/2011/12/23/airserver-0-5-socket-byte-concatenation/">You can find the latest version here :-)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aboutme.be/2011/12/15/airserver-0-4-udp-handling-chrome-16-websockets-bugfixes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UDP Native Extension for AIR Mobile &#8211; now with Android Support!</title>
		<link>http://blog.aboutme.be/2011/12/14/udp-native-extension-for-air-mobile-now-with-android-support/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=udp-native-extension-for-air-mobile-now-with-android-support</link>
		<comments>http://blog.aboutme.be/2011/12/14/udp-native-extension-for-air-mobile-now-with-android-support/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 19:57:41 +0000</pubDate>
		<dc:creator>wouter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[native extensions]]></category>

		<guid isPermaLink="false">http://blog.aboutme.be/?p=266</guid>
		<description><![CDATA[I&#8217;ve continued my work on my UDP AIR native extension, to add support for Android. I&#8217;m happy to release version 0.2, which adds Android support :-) This means, from now on, you can send / receive UDP packets in your AIR mobile projects on both iOS &#038; Android. If you find any bugs, or have [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve continued my <a href="http://blog.aboutme.be/2011/12/10/udp-in-air-for-ios-using-a-native-extension/">work on my UDP AIR native extension</a>, to add support for Android. I&#8217;m happy to release version 0.2, which adds Android support :-)</p>
<p><img src="http://blog.aboutme.be/wp-content/uploads/2011/12/droid.jpg" alt="" title="droid" width="265" height="400" class="aligncenter size-full wp-image-267" /></p>
<p>This means, from now on, you can send / receive UDP packets in your AIR mobile projects on both iOS &#038; Android. If you find any bugs, or have suggestions, please let me know.</p>
<p><a href="http://labs.aboutme.be/native_extensions/udpsocket/udpsocket_0.2.zip">You can download the updated ane, and all the sources</a>.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aboutme.be/2011/12/14/udp-native-extension-for-air-mobile-now-with-android-support/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>UDP in AIR for iOS using a native extension</title>
		<link>http://blog.aboutme.be/2011/12/10/udp-in-air-for-ios-using-a-native-extension/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=udp-in-air-for-ios-using-a-native-extension</link>
		<comments>http://blog.aboutme.be/2011/12/10/udp-in-air-for-ios-using-a-native-extension/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 15:54:36 +0000</pubDate>
		<dc:creator>wouter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[native extensions]]></category>

		<guid isPermaLink="false">http://blog.aboutme.be/?p=259</guid>
		<description><![CDATA[update: added Android support to the extension. When you&#8217;re using a mobile device as a controller for an application or a game, you&#8217;ll want fast data transfers. Classic TCP/IP traffic over sockets is a bit slow, due to the nature of TCP/IP (packets are delivered in the correct order, the receiver sends a confirmation of [...]]]></description>
			<content:encoded><![CDATA[<p><strong>update: <a href="http://blog.aboutme.be/2011/12/14/udp-native-extension-for-air-mobile-now-with-android-support/">added Android support to the extension</a>.</strong></p>
<p>When you&#8217;re using a mobile device as a controller for an application or a game, you&#8217;ll want fast data transfers. Classic TCP/IP traffic over sockets is a bit slow, due to the nature of TCP/IP (packets are delivered in the correct order, the receiver sends a confirmation of reception to the sender for each received packet). The alternative is UDP: you&#8217;re not sure if the packet arrives, or in what order you packets will arrive at the destination, but because of that, there is less delay between the sender and the receiver of the packet.</p>
<p>AIR has a builtin class to handle UDP: flash.net.DatagramSocket. However, for some reason this is not available on AIR for mobile devices. I decided to write a native extension (<del datetime="2011-12-14T19:59:22+00:00">only for iOS for now</del>) to offer UDP functionality on AIR for mobile devices. I tried to use the same API as the DatagramSocket for AIR for Desktop, so the principles are the same.</p>
<p><img src="http://blog.aboutme.be/wp-content/uploads/2011/12/screenshot_0.1.png" alt="" title="Example of UDPSocket extension on AIR for iOS" width="310" height="544" class="aligncenter size-full wp-image-261" /></p>
<p>To send packets over UDP, you&#8217;ll create an instance of the UDPSocket class (be.aboutme.nativeExtensions.udp.UDPSocket), and use the send method with a bytearray:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> udpSocket:UDPSocket = <span style="color: #000000; font-weight: bold;">new</span> UDPSocket<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> bytes:ByteArray = <span style="color: #000000; font-weight: bold;">new</span> ByteArray<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
bytes.<span style="color: #006600;">writeUTFBytes</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Hello World&quot;</span><span style="color: #66cc66;">&#41;</span>;
udpSocket.<span style="color: #0066CC;">send</span><span style="color: #66cc66;">&#40;</span>bytes, <span style="color: #ff0000;">&quot;192.168.9.1&quot;</span>, <span style="color: #cc66cc;">1234</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>To receive packets, you&#8217;ll use the bind(portnr) and receive() methods of the same class, and listen to a DatagramSocketEvent.DATA event:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> udpSocket:UDPSocket = <span style="color: #000000; font-weight: bold;">new</span> UDPSocket<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
udpSocket.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>DatagramSocketDataEvent.<span style="color: #0066CC;">DATA</span>, udpDataHandler<span style="color: #66cc66;">&#41;</span>;
udpSocket.<span style="color: #006600;">bind</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1234</span><span style="color: #66cc66;">&#41;</span>;
udpSocket.<span style="color: #006600;">receive</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
protected <span style="color: #000000; font-weight: bold;">function</span> udpDataHandler<span style="color: #66cc66;">&#40;</span>event:DatagramSocketDataEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>It will transfer whatever you put in the bytearray, so you can send native actionscript objects aswell if you want:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> bytes:ByteArray = <span style="color: #000000; font-weight: bold;">new</span> ByteArray<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> o:<span style="color: #0066CC;">Object</span> = <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>;
o.<span style="color: #006600;">command</span> = <span style="color: #ff0000;">&quot;MESSAGE&quot;</span>;
o.<span style="color: #006600;">content</span> = <span style="color: #ff0000;">&quot;Hello World!&quot;</span>;
bytes.<span style="color: #006600;">writeObject</span><span style="color: #66cc66;">&#40;</span>o<span style="color: #66cc66;">&#41;</span>;
udpSocket.<span style="color: #0066CC;">send</span><span style="color: #66cc66;">&#40;</span>bytes, <span style="color: #ff0000;">&quot;192.168.9.1&quot;</span>, <span style="color: #cc66cc;">1234</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>You can <a href="http://labs.aboutme.be/native_extensions/udpsocket/udpsocket_0.2.zip">download the compiled ane file, together with the actionscript &#038; objectiveC sources and 2 sample projects</a>. The native extension id is &#8220;be.aboutme.nativeExtensions.udp.UDPSocket&#8221;. <del datetime="2011-12-14T19:59:22+00:00">Stay tuned for the Android version</del> The extension has been updated, and supports Android aswell now!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aboutme.be/2011/12/10/udp-in-air-for-ios-using-a-native-extension/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>including dylib in air native extension for OSX</title>
		<link>http://blog.aboutme.be/2011/12/03/including-dylib-in-air-native-extension-for-osx/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=including-dylib-in-air-native-extension-for-osx</link>
		<comments>http://blog.aboutme.be/2011/12/03/including-dylib-in-air-native-extension-for-osx/#comments</comments>
		<pubDate>Sat, 03 Dec 2011 10:10:04 +0000</pubDate>
		<dc:creator>wouter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[native extensions]]></category>
		<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://blog.aboutme.be/?p=252</guid>
		<description><![CDATA[I&#8217;ve been struggling a bit to create a framework file to use in an air native extension on OSX. The issue was that I was using 3rd party dylib libraries (intel building blocks), which aren&#8217;t normally installed on somebody&#8217;s computer. The framework compiled and everything, but for some reason the application crashed when using the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been struggling a bit to create a framework file to use in an air native extension on OSX. The issue was that I was using 3rd party dylib libraries (intel building blocks), which aren&#8217;t normally installed on somebody&#8217;s computer. The framework compiled and everything, but for some reason the application crashed when using the native extension.</p>
<p>When air loaded the native extension, it could no longer find the necessary dylib files. Solution was:</p>
<p>- add a copy files phase to your build phases, which should copy your dylib file to the Resources directory of your framework<br />
- after compilation, open up a terminal window and navigate to your build folder. Use the otool -L command to get a listing of the linked libraries:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">otool <span style="color: #660033;">-L</span> HelloThreadsAndUSB.framework<span style="color: #000000; font-weight: bold;">/</span>HelloThreadsAndUSB</pre></div></div>

<p>Output is something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">HelloThreadsAndUSB:
	<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Frameworks<span style="color: #000000; font-weight: bold;">/</span>HelloThreadsAndUSB.framework<span style="color: #000000; font-weight: bold;">/</span>Versions<span style="color: #000000; font-weight: bold;">/</span>A<span style="color: #000000; font-weight: bold;">/</span>HelloThreadsAndUSB <span style="color: #7a0874; font-weight: bold;">&#40;</span>compatibility version 1.0.0, current version 1.0.0<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">@</span>rpath<span style="color: #000000; font-weight: bold;">/</span>Adobe AIR.framework<span style="color: #000000; font-weight: bold;">/</span>Versions<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.0</span><span style="color: #000000; font-weight: bold;">/</span>Adobe AIR <span style="color: #7a0874; font-weight: bold;">&#40;</span>compatibility version 1.0.0, current version 1.0.0<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Frameworks<span style="color: #000000; font-weight: bold;">/</span>Cocoa.framework<span style="color: #000000; font-weight: bold;">/</span>Versions<span style="color: #000000; font-weight: bold;">/</span>A<span style="color: #000000; font-weight: bold;">/</span>Cocoa <span style="color: #7a0874; font-weight: bold;">&#40;</span>compatibility version 1.0.0, current version 15.0.0<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	libtbb.dylib <span style="color: #7a0874; font-weight: bold;">&#40;</span>compatibility version 0.0.0, current version 0.0.0<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libstdc++.6.dylib <span style="color: #7a0874; font-weight: bold;">&#40;</span>compatibility version 7.0.0, current version 7.9.0<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libSystem.B.dylib <span style="color: #7a0874; font-weight: bold;">&#40;</span>compatibility version 1.0.0, current version 125.2.11<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>In my case, the libtbb.dylib file could not be found when the application launched. You need to change the lookup path with the install_name_tool command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">install_name_tool <span style="color: #660033;">-change</span> libtbb.dylib <span style="color: #000000; font-weight: bold;">@</span>loader_path<span style="color: #000000; font-weight: bold;">/</span>Resources<span style="color: #000000; font-weight: bold;">/</span>libtbb.dylib HelloThreadsAndUSB.framework<span style="color: #000000; font-weight: bold;">/</span>HelloThreadsAndUSB</pre></div></div>

<p>When you type in the otool command again, you should see the adjusted path:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">HelloThreadsAndUSB:
	<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Frameworks<span style="color: #000000; font-weight: bold;">/</span>HelloThreadsAndUSB.framework<span style="color: #000000; font-weight: bold;">/</span>Versions<span style="color: #000000; font-weight: bold;">/</span>A<span style="color: #000000; font-weight: bold;">/</span>HelloThreadsAndUSB <span style="color: #7a0874; font-weight: bold;">&#40;</span>compatibility version 1.0.0, current version 1.0.0<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">@</span>rpath<span style="color: #000000; font-weight: bold;">/</span>Adobe AIR.framework<span style="color: #000000; font-weight: bold;">/</span>Versions<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.0</span><span style="color: #000000; font-weight: bold;">/</span>Adobe AIR <span style="color: #7a0874; font-weight: bold;">&#40;</span>compatibility version 1.0.0, current version 1.0.0<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Frameworks<span style="color: #000000; font-weight: bold;">/</span>Cocoa.framework<span style="color: #000000; font-weight: bold;">/</span>Versions<span style="color: #000000; font-weight: bold;">/</span>A<span style="color: #000000; font-weight: bold;">/</span>Cocoa <span style="color: #7a0874; font-weight: bold;">&#40;</span>compatibility version 1.0.0, current version 15.0.0<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">@</span>loader_path<span style="color: #000000; font-weight: bold;">/</span>Resources<span style="color: #000000; font-weight: bold;">/</span>libtbb.dylib <span style="color: #7a0874; font-weight: bold;">&#40;</span>compatibility version 0.0.0, current version 0.0.0<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libstdc++.6.dylib <span style="color: #7a0874; font-weight: bold;">&#40;</span>compatibility version 7.0.0, current version 7.9.0<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libSystem.B.dylib <span style="color: #7a0874; font-weight: bold;">&#40;</span>compatibility version 1.0.0, current version 125.2.11<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Now you should be able to use this framework in your air native extension :-)</p>
<p>(Note: I tried the other options @executable_path and @rpath, but those didn&#8217;t do the trick)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aboutme.be/2011/12/03/including-dylib-in-air-native-extension-for-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Mobile Tabbed View Navigator Button Badge</title>
		<link>http://blog.aboutme.be/2011/10/28/flex-mobile-tabbed-view-navigator-button-badge/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=flex-mobile-tabbed-view-navigator-button-badge</link>
		<comments>http://blog.aboutme.be/2011/10/28/flex-mobile-tabbed-view-navigator-button-badge/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 14:03:12 +0000</pubDate>
		<dc:creator>wouter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[skinning]]></category>

		<guid isPermaLink="false">http://blog.aboutme.be/?p=222</guid>
		<description><![CDATA[I wanted to display a &#8220;badge text&#8221; in a Flex Mobile project. Badge texts are the red circles on iOS, where you can see a number of updates, unread messages, &#8230; This isn&#8217;t included in the default flex mobile components / skins, so I decided to extend &#038; skin the tabbed view navigator, so you&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to display a &#8220;badge text&#8221; in a Flex Mobile project. Badge texts are the red circles on iOS, where you can see a number of updates, unread messages, &#8230;</p>
<p><img src="http://blog.aboutme.be/wp-content/uploads/2011/10/Screen-Shot-2011-10-28-at-15.52.17.png" alt="" title="Badge texts on tabbed view navigator" width="434" height="596" class="aligncenter size-full wp-image-223" /></p>
<p>This isn&#8217;t included in the default flex mobile components / skins, so I decided to extend &#038; skin the tabbed view navigator, so you&#8217;re able to add this functionality in your applications.</p>
<p>You simple use my BadgeViewNavigator instead of ViewNavigators, and set a badgeText value to display in the badge:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;views:BadgeViewNavigator</span> label=<span style="color: #ff0000;">&quot;One&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span></span>
<span style="color: #000000;">		firstView=<span style="color: #ff0000;">&quot;be.aboutme.flex.mobile.badgeViewNavigator.views.OneView&quot;</span></span>
<span style="color: #000000;">		badgeText=<span style="color: #ff0000;">&quot;23&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;views:BadgeViewNavigator</span> label=<span style="color: #ff0000;">&quot;Two&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span></span>
<span style="color: #000000;">		firstView=<span style="color: #ff0000;">&quot;be.aboutme.flex.mobile.badgeViewNavigator.views.TwoView&quot;</span></span>
<span style="color: #000000;">		badgeText=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;views:BadgeViewNavigator</span> label=<span style="color: #ff0000;">&quot;Three&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span></span>
<span style="color: #000000;">		firstView=<span style="color: #ff0000;">&quot;be.aboutme.flex.mobile.badgeViewNavigator.views.ThreeView&quot;</span><span style="color: #7400FF;">/&gt;</span></span></pre></div></div>

<p><a href="http://labs.aboutme.be/flex_mobile/badge_view_navigator/BadgeViewNavigatorDemo.fxp">You can download the sources &#038; demo in this fxp file. Enjoy!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aboutme.be/2011/10/28/flex-mobile-tabbed-view-navigator-button-badge/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Kinect native extension for Adobe AIR</title>
		<link>http://blog.aboutme.be/2011/10/02/kinect-native-extension-for-adobe-air/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=kinect-native-extension-for-adobe-air</link>
		<comments>http://blog.aboutme.be/2011/10/02/kinect-native-extension-for-adobe-air/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 17:32:06 +0000</pubDate>
		<dc:creator>wouter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.aboutme.be/?p=217</guid>
		<description><![CDATA[Update: This sample only supports the beta1 SDK on windows. Please check out http://www.as3nui.com, where further development is happening (newer SDK versions, support for OSX). I&#8217;ve been playing with native extensions for air for a couple of weeks now. One of the things I wanted to do, was to get the Kinect working through a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update: This sample only supports the beta1 SDK on windows. Please check out <a href="http://www.as3nui.com" target="_blank">http://www.as3nui.com</a>, where further development is happening (newer SDK versions, support for OSX).</strong></p>
<p>I&#8217;ve been playing with native extensions for air for a couple of weeks now. One of the things I wanted to do, was to get the Kinect working through a native extension. I&#8217;ve posted some sample libraries before, where the kinect date was sent to Adobe AIR through UDP sockets. However, the bandwith is quite limited, and there are noticable delays.</p>
<p>Using a native extension, we don&#8217;t have those limitations anymore. Another pro is that we don&#8217;t need to run a seperate program to send the data to our flash application.</p>
<p>I&#8217;ve got multiple skeleton tracking working, together with the video and the depth video.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">kinect = <span style="color: #000000; font-weight: bold;">new</span> Kinect<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
kinect.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>KinectEvent.<span style="color: #006600;">SKELETON_TRACKED</span>, skeletonTrackedHandler, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
kinect.<span style="color: #006600;">startTracking</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
kinectVideo = <span style="color: #000000; font-weight: bold;">new</span> KinectVideo<span style="color: #66cc66;">&#40;</span>kinect<span style="color: #66cc66;">&#41;</span>;
kinectVideo.<span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
addChild<span style="color: #66cc66;">&#40;</span>kinectVideo<span style="color: #66cc66;">&#41;</span>;
&nbsp;
kinectDepth = <span style="color: #000000; font-weight: bold;">new</span> KinectDepth<span style="color: #66cc66;">&#40;</span>kinect<span style="color: #66cc66;">&#41;</span>;
kinectDepth.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;">650</span>;
kinectDepth.<span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
addChild<span style="color: #66cc66;">&#40;</span>kinectDepth<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>displaying the skeleton is pretty straightforward:</p>

<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> drawSkeletons<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	skeletonsContainer.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">clear</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">for</span> <span style="color: #b1b100;">each</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> skeleton:Skeleton <span style="color: #b1b100;">in</span> kinect.<span style="color: #006600;">skeletons</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">for</span> <span style="color: #b1b100;">each</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> joint:Joint <span style="color: #b1b100;">in</span> skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			drawJoint<span style="color: #66cc66;">&#40;</span>joint<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #808080; font-style: italic;">//draw some bones</span>
		drawBone<span style="color: #66cc66;">&#40;</span>skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">SHOULDER_CENTER</span><span style="color: #66cc66;">&#93;</span>, skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">SHOULDER_LEFT</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		drawBone<span style="color: #66cc66;">&#40;</span>skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">SHOULDER_LEFT</span><span style="color: #66cc66;">&#93;</span>, skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">ELBOW_LEFT</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		drawBone<span style="color: #66cc66;">&#40;</span>skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">ELBOW_LEFT</span><span style="color: #66cc66;">&#93;</span>, skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">WRIST_LEFT</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		drawBone<span style="color: #66cc66;">&#40;</span>skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">WRIST_LEFT</span><span style="color: #66cc66;">&#93;</span>, skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">HAND_LEFT</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		drawBone<span style="color: #66cc66;">&#40;</span>skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">SHOULDER_CENTER</span><span style="color: #66cc66;">&#93;</span>, skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">SHOULDER_RIGHT</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		drawBone<span style="color: #66cc66;">&#40;</span>skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">SHOULDER_RIGHT</span><span style="color: #66cc66;">&#93;</span>, skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">ELBOW_RIGHT</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		drawBone<span style="color: #66cc66;">&#40;</span>skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">ELBOW_RIGHT</span><span style="color: #66cc66;">&#93;</span>, skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">WRIST_RIGHT</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		drawBone<span style="color: #66cc66;">&#40;</span>skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">WRIST_RIGHT</span><span style="color: #66cc66;">&#93;</span>, skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">HAND_RIGHT</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		drawBone<span style="color: #66cc66;">&#40;</span>skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">SHOULDER_LEFT</span><span style="color: #66cc66;">&#93;</span>, skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">SPINE</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		drawBone<span style="color: #66cc66;">&#40;</span>skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">SHOULDER_RIGHT</span><span style="color: #66cc66;">&#93;</span>, skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">SPINE</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		drawBone<span style="color: #66cc66;">&#40;</span>skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">SPINE</span><span style="color: #66cc66;">&#93;</span>, skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">HIP_CENTER</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		drawBone<span style="color: #66cc66;">&#40;</span>skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">HIP_CENTER</span><span style="color: #66cc66;">&#93;</span>, skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">HIP_LEFT</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		drawBone<span style="color: #66cc66;">&#40;</span>skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">HIP_LEFT</span><span style="color: #66cc66;">&#93;</span>, skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">KNEE_LEFT</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		drawBone<span style="color: #66cc66;">&#40;</span>skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">KNEE_LEFT</span><span style="color: #66cc66;">&#93;</span>, skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">ANKLE_LEFT</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		drawBone<span style="color: #66cc66;">&#40;</span>skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">ANKLE_LEFT</span><span style="color: #66cc66;">&#93;</span>, skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">FOOT_LEFT</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		drawBone<span style="color: #66cc66;">&#40;</span>skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">HIP_CENTER</span><span style="color: #66cc66;">&#93;</span>, skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">HIP_RIGHT</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		drawBone<span style="color: #66cc66;">&#40;</span>skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">HIP_RIGHT</span><span style="color: #66cc66;">&#93;</span>, skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">KNEE_RIGHT</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		drawBone<span style="color: #66cc66;">&#40;</span>skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">KNEE_RIGHT</span><span style="color: #66cc66;">&#93;</span>, skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">ANKLE_RIGHT</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		drawBone<span style="color: #66cc66;">&#40;</span>skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">ANKLE_RIGHT</span><span style="color: #66cc66;">&#93;</span>, skeleton.<span style="color: #006600;">joints</span><span style="color: #66cc66;">&#91;</span>Joint.<span style="color: #006600;">FOOT_RIGHT</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> drawJoint<span style="color: #66cc66;">&#40;</span>joint:Joint<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	skeletonsContainer.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span>0x000000<span style="color: #66cc66;">&#41;</span>;
	skeletonsContainer.<span style="color: #006600;">graphics</span>.<span style="color: #006600;">drawCircle</span><span style="color: #66cc66;">&#40;</span>joint.<span style="color: #006600;">x</span> <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">640</span>, joint.<span style="color: #006600;">y</span> <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">480</span>, <span style="color: #cc66cc;">10</span> <span style="color: #66cc66;">/</span> joint.<span style="color: #006600;">z</span><span style="color: #66cc66;">&#41;</span>;
	skeletonsContainer.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">endFill</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> drawBone<span style="color: #66cc66;">&#40;</span>from:Joint, to:Joint<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	skeletonsContainer.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">lineStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
	skeletonsContainer.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">moveTo</span><span style="color: #66cc66;">&#40;</span>from.<span style="color: #006600;">x</span> <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">640</span>, from.<span style="color: #006600;">y</span> <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">480</span><span style="color: #66cc66;">&#41;</span>;
	skeletonsContainer.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span>to.<span style="color: #006600;">x</span> <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">640</span>, to.<span style="color: #006600;">y</span> <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">480</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>You can <a href="http://labs.aboutme.be/kinectextension/KinectExtensionTest.fxp">download the flash builder project</a> and the <a href="http://labs.aboutme.be/kinectextension/KinectExtension.zip">visual studio project for the native extension</a>. I didn&#8217;t have any C programming experience before, so there&#8217;s probably room for improvement on the C side. Currently, the extension is only available for windows using the kinect sdk. Make sure you&#8217;ve installed the microsoft kinect sdk, aswell as visual studio. You&#8217;ll also need to launch the flash builder project using my ant build script which is included in the flash builder project. You&#8217;ll want to update the path to your air sdk in the ant-debug.xml.</p>
<p>If you want to see it live in action, come check out our session &#8220;interREACT with the flas platform&#8221; at the FITC unconference at MAX (tuesday).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aboutme.be/2011/10/02/kinect-native-extension-for-adobe-air/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>AIR Native extensions Hello World Example &amp; ANT Script</title>
		<link>http://blog.aboutme.be/2011/09/12/air-native-extensions-hello-world-example-ant-script/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=air-native-extensions-hello-world-example-ant-script</link>
		<comments>http://blog.aboutme.be/2011/09/12/air-native-extensions-hello-world-example-ant-script/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 09:25:58 +0000</pubDate>
		<dc:creator>wouter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[native extensions]]></category>

		<guid isPermaLink="false">http://blog.aboutme.be/?p=213</guid>
		<description><![CDATA[I red about native extensions in the recent version of Adobe AIR 3.0, and decided to play with it. There aren&#8217;t that many examples online yet, the only resources I found were the devnet article from Oliver Goldman and a blog post about invoking ICU from Adobe AIR. I don&#8217;t know any C++ at all, [...]]]></description>
			<content:encoded><![CDATA[<p>I red about native extensions in the recent version of Adobe AIR 3.0, and decided to play with it. There aren&#8217;t that many examples online yet, the only resources I found were <a href="http://www.adobe.com/devnet/air/articles/extending-air.html">the devnet article from Oliver Goldman</a> and <a href="http://blogs.adobe.com/globalization/eo/invoking-icu-from-adobe-air-applications-2/">a blog post about invoking ICU from Adobe AIR</a>.<span id="more-213"></span></p>
<p>I don&#8217;t know any C++ at all, so it was quite a challenge to build a working dll and getting Adobe AIR to talk to it. Right now, all my example does is simple return the message it gets from Adobe AIR back. But it might form a starting point to build more exciting stuff on top of it.</p>
<p>Building and testing the native extensions is quite some command-line work, so I decided to put it in an ant script, which builds the .ANE file, extracts it and starts a AIR debug session with the extension.</p>
<p>You can<a href="http://labs.aboutme.be/native_extensions/HelloWorldExtension_VisualStudio.rar"> download the visual studio project</a> and <a href="http://labs.aboutme.be/native_extensions/HelloWorldExtensionWorkflow.fxp">the flash builder project</a>. The flash builder project comes with an ant script (ant-debug.xml), which does the native extension packaging &#038; debug launch. You may need to change the path to your Adobe AIR sdk in the ant-debug.xml file.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aboutme.be/2011/09/12/air-native-extensions-hello-world-example-ant-script/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
	</channel>
</rss>

