<?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>Eightlines Creations &#187; ActionScript</title>
	<atom:link href="http://www.eightlines.com/blog/category/code/actionscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.eightlines.com/blog</link>
	<description>Experiments in Physical Computing</description>
	<lastBuildDate>Wed, 09 Jun 2010 19:09:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Augmented Reality</title>
		<link>http://www.eightlines.com/blog/2009/01/augmented-reality/</link>
		<comments>http://www.eightlines.com/blog/2009/01/augmented-reality/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 19:00:45 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Ideas]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=149</guid>
		<description><![CDATA[Recently Saqoosha&#8217;s port of ARToolkit from C to Flash has taken the Flash world by storm. The biggest hurdle for me was that the comments in the source were all in Japanese. That was until Mikko Haapoja published a getting started in FLARToolkit entry. Now we&#8217;re witnessing an onslaught of Augmented Reality projections available right [...]]]></description>
			<content:encoded><![CDATA[<p>Recently <a title="Saqoosha's Blog" href="http://saqoosha.net/en/" target="_blank">Saqoosha</a>&#8217;s port of ARToolkit from C to Flash has taken the Flash world by storm. The biggest hurdle for me was that the comments in the source were all in Japanese. That was until <a title="Mikkoh's Blog" href="http://www.mikkoh.com/blog/" target="_blank">Mikko Haapoja</a> published a getting started in FLARToolkit entry. Now we&#8217;re witnessing an onslaught of <a title="Wikipedia entry on Augmented Reality" href="http://en.wikipedia.org/wiki/Augmented_reality" target="_blank">Augmented Reality</a> projections available right in our&nbsp;browsers.</p>
<p>My initial experiments with the toolkit are really no different from anyone else&#8217;s. I had <a title="Neil Marshall's Portfolio" href="http://eightlines.com/neil/" target="_blank">Neil</a> send me a 3D model which we skinned and dropped into Papervision. Immediately the clients at work started to pay attention. But aside from seeing a thousand advertising campaigns six months from now all with their own 3D model that spins around, what can we do with this&nbsp;technology?</p>
<ul>
<li>Most computers outfitted with webcams have the camera&#8217;s targetted at the user&#8217;s face. This means the marker used to identify the placement of the model should be placed in that zone in order for a 3D model to appear. On my development system I&#8217;m using a <span class="caps">PS2</span> Eyetoy, which is a camera on a <span class="caps">USB</span> cable enabling it to be moved around. In many user situations this will not be the case&thinsp;&#8212;&thinsp;so orient your models with the marker standing&nbsp;up.</li>
<li>Through the input I&#8217;ve received markers with thin lines in them tend not to be recognized at long distances. This could be due to the resolution of my camera, but even with a high resolution web cam it will cause a problem at longer distances. Make your marker files bold without fine detail and they should work better in different environments (poor lighting, greater distance, oblique&nbsp;angles).</li>
<li>Print your marker on card stock. If the marker bends it won&#8217;t register. I&#8217;ve found smaller markers won&#8217;t distort as&nbsp;much.</li>
</ul>
<p>Now currently I&#8217;m working on adding some physics to the 3D scene. I&#8217;m using a mixture of Papervision and <a title="WOW-Engine AS3 Physics" href="http://seraf.mediabox.fr/wow-engine/as3-3d-physics-engine-wow-engine/" target="_blank"><span class="caps">WOW</span>-Engine</a>. One of the difficulties I&#8217;m encountering is determining the rotation of the marker. From what I&#8217;ve determined, the Papervision camera is static. The camera is your eye which looks at the marker. As the marker changes orientation the camera does not move. Within FLARToolkit the scene includes a class named FLARBaseNode which extends DisplayObject3D. Tracing out rotationX/Y/Z results in 0/0/0 as the marker rotates. But what is shifting is the rotation matrix of the FLARBaseNode. So essentially if we wish to derive the rotationX/Y/Z we need to retrieve the Matrix3D of the FLARBaseNode and translate the coordinates back into degrees. From what I&#8217;ve been told, Papervision includes a static method Matrix3D.matrix2Euler() which should provide this data returning&nbsp;radians.</p>
<p>And I&#8217;ve been at this off and on for three days now but haven&#8217;t quite found the results I&#8217;m looking for. I&#8217;ll be sure to post more (plus examples) once I get everything working. In the meantime, this <a href="http://www.flipcode.com/documents/matrfaq.html" target="_blank">document</a> does a brilliant job explaining&nbsp;Matrix3D.</p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/eightlines.com/blog/p=149</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Thinking out loud &#8212; Arduino as Webcam</title>
		<link>http://www.eightlines.com/blog/2008/12/thinking-out-loud-arduino-as-webcam/</link>
		<comments>http://www.eightlines.com/blog/2008/12/thinking-out-loud-arduino-as-webcam/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 19:51:55 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=131</guid>
		<description><![CDATA[Lately much of my work has been dealing with getting Flash to talk to the Arduino. There&#8217;s no real functionality to do this on its own, so you have to rely on some other components to host the conversation. There&#8217;s a whole host of methods you can use&#160;here: Socket Connection - This requires a socket [...]]]></description>
			<content:encoded><![CDATA[<p>Lately much of my work has been dealing with getting Flash to talk to the Arduino. There&#8217;s no real functionality to do this on its own, so you have to rely on some other components to host the conversation. There&#8217;s a whole host of methods you can use&nbsp;here:</p>
<ul>
<li>Socket Connection - This requires a socket policy to be set up on the server or else you&#8217;ll get a nasty SecurityError. I used Processing to open the connection, and Flash connects to that socket. Check out this <a title="Socket Connection" href="http://www.mikkoh.com/blog/?p=50" target="_blank">version</a> by Mikko Haapoja which uses Processing to generate OpenGL and pass it to Flash as a ByteArray. You pass bytes from here. Also check out <a title="AS3Glue" href="http://code.google.com/p/as3glue/" target="_blank">AS3Glue</a> which extends the Socket&nbsp;Connection.</li>
<li><a title="Merapi Project Home" href="http://www.merapiproject.net/" target="_blank">Merapi</a> - This bridges Java and&nbsp;Flash. </li>
<li><a title="Serproxy" href="http://www.arduino.cc/en/Main/Software" target="_blank">Serproxy</a> - Included with Arduino, different versions for Mac/Win/Linux. I had difficulty with Serproxy on a Mac and had to switch to a <a title="Serial Server" href="http://itp.nyu.edu/~dbo3/SerialServer/SerialServer.html" target="_blank">Java&nbsp;version</a>.</li>
</ul>
<div>All of these work, but the issue is that it still requires a second piece of software to be installed to mediate the connection. In an ideal world it would be nice if Flash could handle the Serial connection itself. This would probably fall under the <span class="caps">AIR</span> umbrella in order to properly handle the security permissions. </div>
<div>From what I understand this is a common request to Adobe, and there&#8217;s no date that has been set for the feature. This has got me thinking if there&#8217;s a way to do it ourselves. (Note: I have no experience writing drivers, so I&#8217;m just speculating at this point.)</div>
<div></div>
<div>The general idea is to write a driver that would fool the <span class="caps">OS</span> into thinking the Arduino is a webcam. With Flash having native support for the webcam, content sent from the Arduino would be received through the <a title="Camera Class" href="http://livedocs.adobe.com/flex/3/langref/flash/media/Camera.html" target="_blank">Camera class</a> (which is Final, so we can&#8217;t extend it). The video object would connect to Camera and interpret the transmission as a ByteArray. Theoretically, this would only give us Read ability. </div>
<div></div>
<div>This still leaves us with another piece of software to install, so in the end we&#8217;re no further ahead than we were using a proxy connection.</div>
<div></div>
<div>Before I dig in and figure out how to build a webcam driver, anyone have any input? Has anyone produced a simillar project? I&#8217;ve been searching for a while now and haven&#8217;t come up with any useful information. </div>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/eightlines.com/blog/p=131</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mapping GPS Data</title>
		<link>http://www.eightlines.com/blog/2008/11/mapping-gps-data/</link>
		<comments>http://www.eightlines.com/blog/2008/11/mapping-gps-data/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 20:35:33 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Data Logger]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[Maps]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=105</guid>
		<description><![CDATA[When I last left the data logger project off I was having quite a few issues with managing the size of the data in the allotted EEPROM space on board the Arduino. I built up an SDCard writer based on several specs I found in the messageboard and it worked flawlessly. I successfully captured RPM [...]]]></description>
			<content:encoded><![CDATA[<p>When I last left the data logger project off I was having quite a few issues with managing the size of the data in the allotted <a title="EEPROM Build" href="http://www.eightlines.com/blog/2008/09/data-logging-to-the-arduino-eeprom/" target="_self"><span class="caps">EEPROM</span> space</a> on board the Arduino. I built up an <a title="SDCard writer post" href="http://www.eightlines.com/blog/2008/09/data-logger-next-steps/" target="_self">SDCard writer</a> based on several specs I found in the messageboard and it worked flawlessly. I successfully <a title="RPM Dataset" href="http://www.eightlines.com/projects/eepromDataLogger/" target="_blank">captured <span class="caps">RPM</span> data</a> from my bicycle commute. The problem was, I had no way to correlate one collection of data to the other. Different routes, days, time, weather could all affect the results of the&nbsp;dataset.</p>
<div id="attachment_106" class="wp-caption aligncenter" style="width: 510px"><a title="GPS Logger" href="http://www.eightlines.com/projects/gpsDataLogger/" target="_blank"><img class="size-full wp-image-106" title="GPS Tracking Sample" src="http://www.eightlines.com/blog/wp-content/uploads/2008/11/picture-1.png" alt="" width="500" height="225" /></a><p class="wp-caption-text">Note: Requires Flash Player&nbsp;10</p></div>
<p>It was never on my list of things to do since I knew the battery usage scenario would be so high, but I figured I&#8217;d bite the bullet and go the <span class="caps">GPS</span> route anyways. I picked up <a title="LadyAda GPS Sheild" href="http://www.ladyada.net/make/gpsshield/" target="_blank">LadyAda&#8217;s <span class="caps">GPS</span> Sheild</a> and have had a wonderful time working with it ever&nbsp;since.</p>
<p>I had been working on a way to parse the <span class="caps">NMEA</span> string data from the <span class="caps">GPS</span> device delivers when I figured it would be a perfect way to try out the <a title="Google Maps Flash API" href="http://code.google.com/apis/maps/documentation/flash/" target="_blank">Google Maps Flash <span class="caps">API</span></a> (my previous experience had only been using the JavaScript <span class="caps">API</span>, and Yahoo Maps <span class="caps">API</span>) and Flash Player 10. Flash Player 10 offers a number of new features, one of which being the FileReference <span class="caps">API</span> which allows you to browse for a file on your local machine and load it into the Flash Player without making a round trip to the server. Once loaded I split the text file based on the carriage return and cast all of the <span class="caps">GPS</span> Points to a Vector (another new feature&thinsp;&#8212;&thinsp;typecast Array. The speed difference is quite&nbsp;staggering!).</p>
<p>The end result is plotted on a map and colour coded based on velocity, which is recorded in Knots and translated to Km/h. The end result is a colourful chart of the route I commuted that particular&nbsp;day.</p>
<p>In the screenshot above, note the big red blotch at Allen Gardens&thinsp;&#8212;&thinsp;flat tire. The other red marks are stop lights or&nbsp;streetcars.</p>
<p>An example of the map in action requires some coordinates, so save these <a title="Log File 1" href="http://www.eightlines.com/projects/gpsDataLogger/GPSLOG01.TXT" target="_blank">text</a> <a title="Log File 2" href="http://www.eightlines.com/projects/gpsDataLogger/GPSLOG02.TXT" target="_blank">files</a> to your machine first (contains a couple hundred lines of <span class="caps">NMEA</span> data), and hit the load button in the <a title="GPS Logger" href="http://www.eightlines.com/projects/gpsDataLogger/" target="_blank">map application</a>. Once loaded the map should recentre on the coordinate&nbsp;boundary.</p>
<p>I&#8217;m currently working on some new modifications for the map so I should have more available soon. But first I&#8217;m putting the finishing touches on a wooden case I&#8217;m hand crafting as a shell for the <span class="caps">GPS</span> device. I&#8217;ll have photos up from that project&nbsp;soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/eightlines.com/blog/p=105</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Conversation Clouds with Physics</title>
		<link>http://www.eightlines.com/blog/2008/11/conversation-clouds-with-physics/</link>
		<comments>http://www.eightlines.com/blog/2008/11/conversation-clouds-with-physics/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 03:42:15 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[APE]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[physics]]></category>
		<category><![CDATA[tag cloud]]></category>
		<category><![CDATA[tweener]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=92</guid>
		<description><![CDATA[So after posting the previous entry I went to sleep, only to find myself thinking about improving the visual aspect of the Conversation Cloud. I decided that adding physics would be the way to go, it would allow words to deflect off of each other, grow and gain mass, and constrain themselves to a&#160;container. I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>So after posting the <a href="http://www.eightlines.com/blog/2008/11/conversation-clouds/" target="_self">previous entry</a> I went to sleep, only to find myself thinking about improving the visual aspect of the Conversation Cloud. I decided that adding physics would be the way to go, it would allow words to deflect off of each other, grow and gain mass, and constrain themselves to a&nbsp;container.</p>
<p>I&#8217;ve used <a href="http://www.cove.org/ape/" target="_blank"><span class="caps">APE</span></a> for the physics engine, and <a href="http://code.google.com/p/tweener/" target="_blank">Tweener</a> for some of the elasticity when the mass&nbsp;increases. </p>
<p><script src="/js/swfobject.js" type="text/javascript"></script> <script type="text/javascript"><!--
var flashvars = {};
var params = {};
var attributes = {};
swfobject.embedSWF("http://www.eightlines.com/blog/wp-content/uploads/2008/11/conversationcloud.swf", "demo2", "500", "500", "9.0.0", false, flashvars, params, attributes);
// --></script></p>
<div id="demo2"></div>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/eightlines.com/blog/p=92</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conversation Clouds</title>
		<link>http://www.eightlines.com/blog/2008/11/conversation-clouds/</link>
		<comments>http://www.eightlines.com/blog/2008/11/conversation-clouds/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 02:51:27 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[dictation]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[tag cloud]]></category>
		<category><![CDATA[voice]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=82</guid>
		<description><![CDATA[Word of mouth is one of those impossible things people like to track. The best people seem to be able to do is to ask the question on a registration form, &#8220;Where did you hear about&#160;us?&#8221; Is it possible to track word of mouth any better? This is the premise of my latest project, Conversation&#160;Clouds. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.eightlines.com/blog/wp-content/uploads/2008/11/tagcloud2.swf"></a>Word of mouth is one of those impossible things people like to track. The best people seem to be able to do is to ask the question on a registration form, &#8220;Where did you hear about&nbsp;us?&#8221;</p>
<p>Is it possible to track word of mouth any better? This is the premise of my latest project, Conversation&nbsp;Clouds.</p>
<p>Imagine a conference on multiple floors, with thousands of people. You stand at a screen visualizing all the conversations going on simultaneously. And there on the screen is the general location of a topic you&#8217;re interested in, so you venture down a floor and join&nbsp;in.</p>
<p>Now, privacy concerns aside, the system works as&nbsp;such:</p>
<ul>
<li>Microphones are placed around a physical space. Each is marked with an id which relates to its geographic&nbsp;location.</li>
<li>The audio is transmitted to a server which performs voice to text translations in small&nbsp;batches.</li>
<li>As each sample is translated it pushes to the visualization script which then displays on a central&nbsp;monitor.</li>
</ul>
<p><script src="/js/swfobject.js" type="text/javascript"></script> <script type="text/javascript"><!--
var flashvars = {};
var params = {};
var attributes = {};
swfobject.embedSWF("http://www.eightlines.com/blog/wp-content/uploads/2008/11/tagcloud2.swf", "demo", "500", "500", "9.0.0", false, flashvars, params, attributes);
// --></script></p>
<div id="demo"><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></div>
<p>In this early proof of concept I&#8217;m using recorded conversations left through answering machines which are transcribed into textual form. Once a new message arrives the script parses it through a custom UIComponent in Flex. Words are added to a hashmap and as repetition occurs the visualization increases the scale and opacity. With future versions I hope to add in a decay parameter as well, so as the conversation flows from one topic to the next so does the visualization. (In the demo above I&#8217;m using the content from a previous&nbsp;post.)</p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/eightlines.com/blog/p=82</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Presenting at the Toronto Flex User Group</title>
		<link>http://www.eightlines.com/blog/2008/09/presenting-at-the-toronto-flex-user-group/</link>
		<comments>http://www.eightlines.com/blog/2008/09/presenting-at-the-toronto-flex-user-group/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 14:43:45 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Presentation]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=68</guid>
		<description><![CDATA[Just a quick note that I will be presenting at the Toronto Flex User Group on Thursday October 23rd, 2008 at the Oakham House on the Ryerson Campus, starting at&#160;6:30pm. Oakham House Room: Oakham Lounge 55 Gould Street Toronto, Ontario M5B&#160;1E9 I&#8217;ll be presenting: ActionScript or Flex Project? Development lessons learned building client&#160;projects.]]></description>
			<content:encoded><![CDATA[<p>Just a quick note that I will be presenting at the <a title="Toronto Flex User Group" href="http://www.torontoflex.org/" target="_blank">Toronto Flex User Group</a> on Thursday October 23rd, 2008 at the Oakham House on the Ryerson Campus, starting at&nbsp;6:30pm.</p>
<p><a title="Oakham House Website" href="http://www.oakhamhouse.com/pages/directions.php" target="_blank">Oakham House</a><br />
Room: Oakham Lounge<br />
55 Gould Street<br />
Toronto, Ontario<br />
<span class="caps">M5B</span>&nbsp;1E9</p>
<p>I&#8217;ll be presenting: <em>ActionScript or Flex Project? Development lessons learned building client&nbsp;projects</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/eightlines.com/blog/p=68</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
