<?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>distriqt // labs &#187; as3</title>
	<atom:link href="http://labs.distriqt.com/tag/as3/feed" rel="self" type="application/rss+xml" />
	<link>http://labs.distriqt.com</link>
	<description>flash platform &#38; digital development australia</description>
	<lastBuildDate>Fri, 27 Jan 2012 00:24:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>HEARTweb Sync Application</title>
		<link>http://labs.distriqt.com/post/773</link>
		<comments>http://labs.distriqt.com/post/773#comments</comments>
		<pubDate>Wed, 18 Jan 2012 23:00:47 +0000</pubDate>
		<dc:creator>Michael Archbold</dc:creator>
				<category><![CDATA[work]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[livecycle]]></category>

		<guid isPermaLink="false">http://labs.distriqt.com/?p=773</guid>
		<description><![CDATA[Last year we developed an application for the University of Melbourne, Ultrasound Education Group, Heartweb. The application is a file browsing, support and synchronisation utility for students enrolled in the Ultrasound Education Group's courses. The group had a large amount of course material that traditionally was distributed on media (such as DVDs) to the students. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F773"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F773&amp;source=distriqt&amp;style=normal&amp;service=bit.ly&amp;service_api=R_d2c0f1a5509cd228ab0be545d628ad7a&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Last year we developed an application for the University of Melbourne, Ultrasound Education Group, <a href="http://www.heartweb.com/">Heartweb</a>. The application is a file browsing, support and synchronisation utility for students enrolled in the Ultrasound Education Group's courses.</p>
<p><a href="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/heartweb-browse1.png" rel="shadowbox[sbpost-773];player=img;"><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/heartweb-browse1-600x414.png" alt="" title="heartweb-browse" width="600" height="414" class="alignnone size-medium wp-image-832" /></a></p>
<p>The group had a large amount of course material that traditionally was distributed on media (such as DVDs) to the students. The material was all being protected via Livecycle PDF security policy but they requested a simpler method of distributing and updating the materials.<br />
<span id="more-773"></span></p>
<p>Users' of the application log in and then are presented with a list of material that their policy allows them access to. The content was all moved to the Livecycle server and access was only available through custom developed secure API. </p>
<p>The application allows the user to select material for synchronisation keeping a directory, or individual files, "up-to-date" with the most recent updates to course material. As they browse through the material, files can be viewed or located on the local machine in the default system viewers or in the application where applicable.</p>
<p><a href="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/heartweb-browse1.png" rel="shadowbox[sbpost-773];player=img;"><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/heartweb-browse1-600x414.png" alt="" title="heartweb-browse" width="600" height="414" class="alignnone size-medium wp-image-832" /></a></p>
<p>Additionally links and other information can be passed to the students via the application allowing the course organisers to supply the students with important information through a single application portal.</p>
<p>A web browsing function was included so they could display content from the Heartweb website directly in the application. We used the StageWebView class functionality to achieve this end.</p>
<p><a href="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/heartweb-support.png" rel="shadowbox[sbpost-773];player=img;"><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/heartweb-support-600x360.png" alt="" title="heartweb-support" width="600" height="360" class="alignnone size-medium wp-image-825" /></a></p>
<p><a href="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/heartweb-payment.png" rel="shadowbox[sbpost-773];player=img;"><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/heartweb-payment-600x359.png" alt="" title="heartweb-payment" width="600" height="359" class="alignnone size-medium wp-image-826" /></a></p>
<p>The application is written completely in Adobe AIR, allowing us to deploy across the multiple different platforms that the students used. We used the built in application updating techniques to provide application updates to the students. </p>
<p>Unfortunately, unless you want to sign up to the Heartweb course to get access to the materials, the application is unavailable, but it was a great experience in integrating file synchronisation with a secure document-based internet distribution process.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://labs.distriqt.com/post/773"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://labs.distriqt.com/post/773/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Native Extensions: A Simple Guide</title>
		<link>http://labs.distriqt.com/post/815</link>
		<comments>http://labs.distriqt.com/post/815#comments</comments>
		<pubDate>Tue, 17 Jan 2012 10:30:19 +0000</pubDate>
		<dc:creator>Michael Archbold</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[ane]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flash-builder]]></category>
		<category><![CDATA[native-extension]]></category>

		<guid isPermaLink="false">http://labs.distriqt.com/?p=815</guid>
		<description><![CDATA[We've been doing a lot with Native Extensions for AIR lately, both in Android and iOS, and I just wanted to put together a quick "how to" on using other people's Actionscript Native Extensions (ANE) in Flash Builder 4.6. I'm going to assume you already understand the process of developing and deploying mobile applications using [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F815"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F815&amp;source=distriqt&amp;style=normal&amp;service=bit.ly&amp;service_api=R_d2c0f1a5509cd228ab0be545d628ad7a&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>We've been doing a lot with Native Extensions for AIR lately, both in Android and iOS, and I just wanted to put together a quick "how to" on using other people's Actionscript Native Extensions (ANE) in Flash Builder 4.6.</p>
<p>I'm going to assume you already understand the process of developing and deploying mobile applications using AIR.</p>
<p>The process is quite simple, you'll need the supplied ANE for the extension. In your mobile project you want to add it into, open up the project properties (Right click / Properties) and find the "Actionscript Build Path" (or "Flex Build Path" if it's a Flex project).</p>
<p>You'll see a tab up the top labeled "Native Extensions" in which you can "Add ANE...". Click on this and select the ANE extension file. Once it's added in, you can expand out the details of the extension to see the target platforms supported by the extension. Below I'm showing the details on our Android Camera Extension. </p>
<p><a href="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/ane-build-path1.png" rel="shadowbox[sbpost-815];player=img;"><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/ane-build-path1-548x450.png" alt="" title="ane-build-path" width="548" height="450" class="alignnone size-medium wp-image-818" /></a><br />
<span id="more-815"></span><br />
The extension is now included in your project, however before you leave here I suggest you go to the "Build Packaging" for the platforms you are deploying and check the extension is going to be packaged (and available) with them.</p>
<p><a href="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/ane-build-packaging.png" rel="shadowbox[sbpost-815];player=img;"><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/ane-build-packaging-592x450.png" alt="" title="ane-build-packaging" width="592" height="450" class="alignnone size-medium wp-image-819" /></a> </p>
<p>You should now be able to return to your code and use the functionality and classes supplied in the extension, hopefully you've been supplied with documentation or example usage of the extension!</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://labs.distriqt.com/post/815"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://labs.distriqt.com/post/815/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Schools Disaster Mapper</title>
		<link>http://labs.distriqt.com/post/767</link>
		<comments>http://labs.distriqt.com/post/767#comments</comments>
		<pubDate>Tue, 10 Jan 2012 23:27:41 +0000</pubDate>
		<dc:creator>Michael Archbold</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[google-maps]]></category>
		<category><![CDATA[kml]]></category>
		<category><![CDATA[mashups]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[xmlrpc]]></category>

		<guid isPermaLink="false">http://labs.distriqt.com/?p=767</guid>
		<description><![CDATA[The Disaster Mapper - An interactive Resource for Schools is a project for the Attorney-General's Department, Australian Emergency Management Institute. The aim of the project was to provide an educational resource aimed at school students for investigating Australian natural disasters throughout history. It was developed in 2009 but has just been released to the public. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F767"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F767&amp;source=distriqt&amp;style=normal&amp;service=bit.ly&amp;service_api=R_d2c0f1a5509cd228ab0be545d628ad7a&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>The Disaster Mapper - An interactive Resource for Schools is a project for the Attorney-General's Department, Australian Emergency Management Institute. The aim of the project was to provide an educational resource aimed at school students for investigating Australian natural disasters throughout history.</p>
<p>It was developed in 2009 but has just been released to the public.</p>
<p><a href="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/agd_disastermapper_screen_3.png" rel="shadowbox[sbpost-767];player=img;"><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/agd_disastermapper_screen_3-600x444.png" alt="" title="agd_disastermapper_screen_3" width="600" height="444" class="size-medium wp-image-777" /></a><br />
<span id="more-767"></span></p>
<p>This project made use of the latest Flash technologies with the Google Maps API to provide an interactive map where users could navigate and search disaster information by time, location, disaster types and keywords.</p>
<p>The application uses a very simple series of navigational elements. A series of large buttons allows the user to select the disaster categories of interest and a timeline allows the user to limit the time period displayed. The disasters matching these two filters are then displayed on the map along with overview information of the selected disaster categories in the information panels on the left.</p>
<p>Media associated with each disaster (including images, flv, youtube, viemo, mp3 and other media types) can be viewed either in quick view in the information panels or in the detail overlay.</p>
<p>The system also supported and included additional data such as population, temperature, rainfall and specific high-risk disaster areas which could be overlaid on the map.</p>
<p>The result is a very easy-to-use, interesting website and something suitable for the target audience of school students.</p>

<a href='http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/agd_disastermapper_screen_1.png' rel='shadowbox[sbalbum-767];player=img;' title='agd_disastermapper_screen_1'><img width="150" height="150" src="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/agd_disastermapper_screen_1-150x150.png" class="attachment-thumbnail" alt="agd_disastermapper_screen_1" title="agd_disastermapper_screen_1" /></a>
<a href='http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/agd_disastermapper_screen_2.png' rel='shadowbox[sbalbum-767];player=img;' title='agd_disastermapper_screen_2'><img width="150" height="150" src="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/agd_disastermapper_screen_2-150x150.png" class="attachment-thumbnail" alt="agd_disastermapper_screen_2" title="agd_disastermapper_screen_2" /></a>
<a href='http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/agd_disastermapper_screen_3.png' rel='shadowbox[sbalbum-767];player=img;' title='agd_disastermapper_screen_3'><img width="150" height="150" src="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/agd_disastermapper_screen_3-150x150.png" class="attachment-thumbnail" alt="agd_disastermapper_screen_3" title="agd_disastermapper_screen_3" /></a>
<a href='http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/agd_disastermapper_screen_4.png' rel='shadowbox[sbalbum-767];player=img;' title='agd_disastermapper_screen_4'><img width="150" height="150" src="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/agd_disastermapper_screen_4-150x150.png" class="attachment-thumbnail" alt="agd_disastermapper_screen_4" title="agd_disastermapper_screen_4" /></a>
<a href='http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/agd_disastermapper_screen_5.png' rel='shadowbox[sbalbum-767];player=img;' title='agd_disastermapper_screen_5'><img width="150" height="150" src="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/agd_disastermapper_screen_5-150x150.png" class="attachment-thumbnail" alt="agd_disastermapper_screen_5" title="agd_disastermapper_screen_5" /></a>
<a href='http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/agd_disastermapper_screen_6.png' rel='shadowbox[sbalbum-767];player=img;' title='agd_disastermapper_screen_6'><img width="150" height="150" src="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/agd_disastermapper_screen_6-150x150.png" class="attachment-thumbnail" alt="agd_disastermapper_screen_6" title="agd_disastermapper_screen_6" /></a>
<a href='http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/agd_disastermapper_screen_7.png' rel='shadowbox[sbalbum-767];player=img;' title='agd_disastermapper_screen_7'><img width="150" height="150" src="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/agd_disastermapper_screen_7-150x150.png" class="attachment-thumbnail" alt="agd_disastermapper_screen_7" title="agd_disastermapper_screen_7" /></a>

<p>Making use of some extra available time, distriqt also developed an additional component for the CMS which allowed an administrator to directly edit overlay data on top of a Google Map, using a standard data format (KML). This allowed the client to create more meaningful and suitable overlay information for the website such as risk areas, temperature, population and rainfall data.</p>
<p><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2012/01/agd_disastermapper_screen_7-541x450.png" alt="" title="agd_disastermapper_screen_7" width="541" height="450" class="size-medium wp-image-793" /></p>
<p>The project was delivered on-time and on-budget, and has been well-received by the client, schools, and educators - all feedback has been very positive.</p>
<p>See the site <a href='http://disastermapper.ema.edu.au/' target='_blank'>here</a>.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://labs.distriqt.com/post/767"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://labs.distriqt.com/post/767/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Holden &#8220;Barina Beats&#8221; Game</title>
		<link>http://labs.distriqt.com/post/732</link>
		<comments>http://labs.distriqt.com/post/732#comments</comments>
		<pubDate>Mon, 19 Dec 2011 02:59:33 +0000</pubDate>
		<dc:creator>Michael Archbold</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[robotlegs]]></category>

		<guid isPermaLink="false">http://labs.distriqt.com/?p=732</guid>
		<description><![CDATA[Holden's latest promotion for their Barina includes a game that we developed for ThinkNimble and McCann Melbourne. The game is a Guitar Hero style game, where icons move along the road and the player has to hit the matching key as the icon moves over the hit area. "The aim of the game is to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F732"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F732&amp;source=distriqt&amp;style=normal&amp;service=bit.ly&amp;service_api=R_d2c0f1a5509cd228ab0be545d628ad7a&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://labs.distriqt.com/wordpress/wp-content/uploads/2011/12/barinabeats-2.png" rel="shadowbox[sbpost-732];player=img;"><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2011/12/barinabeats-2-150x150.png" alt="" title="barinabeats-2" width="150" height="150" class="alignleft size-thumbnail wp-image-756" /></a></p>
<p>Holden's latest promotion for their Barina includes a game that we developed for ThinkNimble and McCann Melbourne.</p>
<p>The game is a Guitar Hero style game, where icons move along the road and the player has to hit the matching key as the icon moves over the hit area.</p>
<p>"The aim of the game is to beat the street and score as many points possible by hitting colourful icons as they race down the street! There are eight stages that get more challenging as you play. The prize? Whoever has the highest eligible score at the end of the competition period will win an all-new Holden Barina."</p>
<p><a href="http://labs.distriqt.com/wordpress/wp-content/uploads/2011/12/barinabeats-4.png" rel="shadowbox[sbpost-732];player=img;"><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2011/12/barinabeats-4-600x438.png" alt="" title="barinabeats-4" width="600" height="438" class="aligncenter size-medium wp-image-753" /></a><br />
<span id="more-732"></span></p>
<p>It was created as a Facebook application to tap into the popularity of the growing social gaming market and to promote the features of the all-new Holden Barina. The game features music and sound effects from the radio adverts and TVC. </p>
<p>The competition is running until the end of February 2012. <a href="https://www.facebook.com/HoldenSmallCarCollection">Play the game here</a></p>
<p><iframe width="600" height="340" src="http://www.youtube.com/embed/pkeXLLwGkTI?rel=0" frameborder="0" allowfullscreen></iframe></p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://labs.distriqt.com/post/732"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://labs.distriqt.com/post/732/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Marija Ivkovic Portfolio Application</title>
		<link>http://labs.distriqt.com/post/696</link>
		<comments>http://labs.distriqt.com/post/696#comments</comments>
		<pubDate>Fri, 16 Dec 2011 02:25:57 +0000</pubDate>
		<dc:creator>Michael Archbold</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[AppStore]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[mobile application]]></category>

		<guid isPermaLink="false">http://labs.distriqt.com/?p=696</guid>
		<description><![CDATA[We've been so busy over the last few months that we haven't had a chance to update any information on what we've been doing. So here's the first in a series of updates. One of our clients Marija Ivkovic, an amazing photographer, whose site I did a while ago. In order to show to power [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F696"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F696&amp;source=distriqt&amp;style=normal&amp;service=bit.ly&amp;service_api=R_d2c0f1a5509cd228ab0be545d628ad7a&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>We've been so busy over the last few months that we haven't had a chance to update any information on what we've been doing.</p>
<p>So here's the first in a series of updates.</p>
<p>One of our clients <a href="http://www.marijaivkovic.com">Marija Ivkovic</a>, an amazing photographer, whose site I did a while ago. In order to show to power of Flash we decided to turn her site into a mobile application, by taking the exact same code base from the site and applying a few small tweaks.</p>
<p><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2011/12/marija-ivkovic-app-icon.png" alt="" title="marija-ivkovic-app-icon" width="175" height="175" class="alignleft size-full wp-image-712" /></p>
<p><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2011/12/marija-ivkovic-app-screenshot.jpeg" alt="" title="marija-ivkovic-app-screenshot" width="320" height="480" class="aligncenter size-full wp-image-713" /></p>
<p>The end result was actually quite surprising for a direct port of a website. We obviously added some touch and swipe based interactions, removed the "mouse over" interactions and added in a nifty little database cache process to cache images for offline access, but overall the code base remained relatively unchanged.</p>
<p>We were very excited to be able to supply this as an option for development. Creating an interactive web and mobile application has never been easier or more powerful.</p>
<p>It's available for free for iPhone, iPod Touch and iPad in the App Store.</p>
<p><a href="http://itunes.apple.com/us/app/marija-ivkovic-portfolio/id459956316"><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2011/12/app-store-badge-580x189.png" alt="Available on the App Store" title="Available on the App Store" width="184" height="60" /></a></p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://labs.distriqt.com/post/696"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://labs.distriqt.com/post/696/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>KML Loader Update</title>
		<link>http://labs.distriqt.com/post/577</link>
		<comments>http://labs.distriqt.com/post/577#comments</comments>
		<pubDate>Sun, 19 Jun 2011 11:53:42 +0000</pubDate>
		<dc:creator>Michael Archbold</dc:creator>
				<category><![CDATA[experiments]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[google-maps]]></category>
		<category><![CDATA[kml]]></category>

		<guid isPermaLink="false">http://labs.distriqt.com/?p=577</guid>
		<description><![CDATA[So as many people know, I've been promising an update to the KML Loader for a while now, and even to the point where I've had some local revisions and haven't had the time to check them in (I know, I know, bad practice!) The major update has been to enable the ability to load [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F577"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F577&amp;source=distriqt&amp;style=normal&amp;service=bit.ly&amp;service_api=R_d2c0f1a5509cd228ab0be545d628ad7a&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>So as many people know, I've been promising an update to the KML Loader for a while now, and even to the point where I've had some local revisions and haven't had the time to check them in (I know, I know, bad practice!)</p>
<p><a href="http://labs.distriqt.com/wordpress/wp-content/uploads/2011/06/kmlloader_groundoverlay.png" rel="shadowbox[sbpost-577];player=img;"><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2011/06/kmlloader_groundoverlay.png" alt="" title="KML Loader showing a Ground Overlay" width="580" height="352" class="aligncenter size-full wp-image-580" /></a></p>
<p>The major update has been to enable the ability to load linked assets. Initially this just extends to ground overlays and custom icons, but now that I have the structure setup to do this I'll be able to add in linked files and styles easily. </p>
<p><span id="more-577"></span></p>
<p>Other updates include a series of bug fixes, features with multiple geometries now load in correctly and I've updated the utility library to correctly parse the newer OGC KML namespace.</p>
<p>Some things to note:</p>
<ul>
<li>I've added a trunk directory to keep the main head revision separate from the tag tree</li>
<li>I've removed the included version of the google maps utility library. I've committed in some changes to this library so I didn't want to have to maintain it in two places, so you'll now have to go to the google maps utility library on google code <a href="http://code.google.com/p/gmaps-utility-library-flash/" target="_blank">here</a> (I'll package it all up at the end of this post as well).</li>
<li>I've tagged the previous version of the library if you wish to keep using it, you'll find it at: <code>http://svn.distriqt.com/public/trunk/gmaps/tags/R20101004_gmaps_utils_v1.0</code></li>
<li>I've used the <a href="https://github.com/arthur-debert/BulkLoader" target="_blank">BulkLoader</a> by Arthur Debert and have included it in the repository. This is used to load all the linked assets.</li>
</ul>
<p>The functionality should be exactly the same as the previous version, so you can still refer to the post on <a href="http://labs.distriqt.com/post/421">interactions</a>, about the <a href="http://labs.distriqt.com/post/251">SimpleKMLLoader</a> and the initial post about the <a href="http://labs.distriqt.com/post/164">KmlLoader</a>. </p>
<p>The major change is that you now need to grab the gmaps utility library separately and put both libraries in your source tree. </p>
<p>
<pre>
svn co http://svn.distriqt.com/public/trunk/gmaps/trunk/ distriqt-gmaps
svn co http://gmaps-utility-library-flash.googlecode.com/svn/trunk/ gmaps-utility-library-flash-read-only
</pre>
</p>
<p>You'll end up with a src directory in both of these checkouts that you need to add to your source path for your projects.</p>
<p>Here are the current packages (v1.2) <a href='http://labs.distriqt.com/wordpress/wp-content/uploads/2011/06/distriqt-gmaps-kmlloader.zip'>distriqt-gmaps-kmlloader-v1.2</a> and <a href='http://labs.distriqt.com/wordpress/wp-content/uploads/2011/06/google-utility-library-flash.zip'>google-utility-library-flash</a>.</p>
<p>Let me know if you find it useful!</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://labs.distriqt.com/post/577"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://labs.distriqt.com/post/577/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Lachlan Moore Photography Updated</title>
		<link>http://labs.distriqt.com/post/492</link>
		<comments>http://labs.distriqt.com/post/492#comments</comments>
		<pubDate>Sat, 09 Apr 2011 08:27:34 +0000</pubDate>
		<dc:creator>Michael Archbold</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[royalecms]]></category>

		<guid isPermaLink="false">http://labs.distriqt.com/?p=492</guid>
		<description><![CDATA[We've recently updated Lachlan's site with some new features, including an introduction slideshow, and integration with RoyaleCMS. The CMS is a powerful, rebrandable CMS for any XML driven website or web application. It's a flash/php based CMS and provides a very simple and clean interface especially good for gallery and image based websites. Previously this [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F492"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F492&amp;source=distriqt&amp;style=normal&amp;service=bit.ly&amp;service_api=R_d2c0f1a5509cd228ab0be545d628ad7a&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>We've recently updated Lachlan's site with some new features, including an introduction slideshow, and integration with <a href="http://www.royalecms.com/">RoyaleCMS</a>. The CMS is a powerful, rebrandable CMS for any XML driven website or web application. It's a flash/php based CMS and provides a very simple and clean interface especially good for gallery and image based websites. </p>
<p><a href="http://lachlanmoore.com.au"><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2011/04/lachlanmoore-updated.jpg" alt="" title="lachlanmoore-updated" width="580" height="370" class="aligncenter size-full wp-image-523" /></a></p>
<p><span id="more-492"></span><br />
Previously this site integrated with a Drupal backend, but we found that ordering images in a Drupal gallery was overly complex and was becoming an issue for image management for this site. Hence we decided to try RoyaleCMS.</p>
<p>We had a few minor integration issues but overall it was a simple experience to get our website interfacing to the CMS. The available parser libraries definitely made it an easy experience to get the content from the CMS. Our biggest problem was the difficulty of associating a description with an image. Something that nearly every gallery site requires however it was a bit of a process (though by no means impossible) to get the CMS setup to add this simple piece of metadata.</p>
<p><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2011/04/lachlanmoore-updated-cms.jpg" alt="" title="lachlanmoore-updated-cms" width="580" height="364" class="aligncenter size-full wp-image-527" /></p>
<p>We definitely recommend RoyaleCMS if you're looking for a simple backend to manage a flash portfolio site.</p>
<p>Check out the updated site at <a href="http://lachlanmoore.com.au">lachlanmoore.com.au</a>.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://labs.distriqt.com/post/492"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://labs.distriqt.com/post/492/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Streaming Webcam To a Ubuntu Red5 Server</title>
		<link>http://labs.distriqt.com/post/493</link>
		<comments>http://labs.distriqt.com/post/493#comments</comments>
		<pubDate>Thu, 24 Mar 2011 00:05:44 +0000</pubDate>
		<dc:creator>Michael Archbold</dc:creator>
				<category><![CDATA[experiments]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[red5]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://labs.distriqt.com/?p=493</guid>
		<description><![CDATA[For an upcoming project we needed to stream content from the user's webcam to be recorded on the server. In theory this sounded like a basic operation, having used FMS to this end before, but actually installing and setting up the Red5 server proved to be a little tricky. So I just wanted to outline [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F493"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F493&amp;source=distriqt&amp;style=normal&amp;service=bit.ly&amp;service_api=R_d2c0f1a5509cd228ab0be545d628ad7a&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>For an upcoming project we needed to stream content from the user's webcam to be recorded on the server. In theory this sounded like a basic operation, having used FMS to this end before, but actually installing and setting up the Red5 server proved to be a little tricky. So I just wanted to outline the process I went through to get a Red5 Server running on ubuntu and how to setup your first recording stream.</p>
<p><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2011/03/Red5.png" alt="" title="Red5" width="425" height="169" class="aligncenter size-full wp-image-494" /></p>
<blockquote><p><a href="http://www.red5.org">Red5</a> is a powerful Java based video streaming and multi-user solution for the Flash Player. Red5 includes support for the latest multi-user API’s including NetConnection, NetStream and SharedObject’s while providing a powerful RTMP / Servlet implementation. It is basically an open source Flash Media Server. </p></blockquote>
<p>We're going to go through two major steps here, firstly installing Red5 on Ubuntu and then building a simple application to record the webcam.<br />
<span id="more-493"></span></p>
<p><strong>Installing Red5</strong></p>
<p>For this installation we're going to use a stock Ubuntu Server installation (8.04 Hardy Heron). We installed LAMP as well for the project but it's not required for Red5. Firstly we need to install a few dependencies including the Java runtime environment and the Java development kit (and yes these are terminal commands so get it up and running):</p>
<p><code>sudo apt-get install java-package sun-java6-jdk sun-java6-jre<br />
sudo apt-get install subversion ant</code></p>
<p>Next we need to grab the code base for Red5. We tried the trunk version first but had some issues with it (as you'd expect from a HEAD revision) so ended up using v0.9.1. You can try other versions of the server by browsing the <a href="http://red5.googlecode.com/svn/java/server/tags/">repository</a> and replacing the reference in the svn checkout below:</p>
<p><code>svn co http://red5.googlecode.com/svn/java/server/tags/0_9_1/ ~/red5</code></p>
<p>Now we build using Ant:</p>
<p><code>export JAVA_HOME=/usr/lib/jvm/java-6-sun<br />
export ANT_HOME=/usr/share/ant/<br />
cd ~/red5<br />
/usr/share/ant/bin/ant</code></p>
<p>Make sure there were no errors during the build. If there were consult the red5 wiki for help. Install:</p>
<p><code>sudo mkdir /usr/share/red5<br />
sudo cp -R ~/red5/dist/* /usr/share/red5/.<br />
sudo chmod 755 /usr/share/red5/red5.sh</code></p>
<p>Start the Red5 server:</p>
<p><code>export RED5_HOME=/usr/share/red5<br />
/usr/share/red5/red5.sh</code></p>
<p>Next we need to create the startup script. This script will allow you to get the server starting on reboot etc. Put the following text into the file <code>/etc/init.d/red5</code> and make the file executable <code>sudo chmod 755 /etc/init.d/red5</code>. </p>
<pre class="bash"><span style="color: #808080; font-style: italic;">#!/bin/sh</span>
<span style="color: #808080; font-style: italic;"># init script <span style="color: #000000; font-weight: bold;">for</span> Red5</span>
<span style="color: #808080; font-style: italic;"># /etc/init.d/red5</span>
&nbsp;
<span style="color: #007800;">RED5_USER=</span>root
<span style="color: #007800;">RED5_HOME=</span>/usr/share/red5
<span style="color: #007800;">RED5_PROG=</span>red5
&nbsp;
<span style="color: #7a0874; font-weight: bold;">test</span> -x <span style="color: #007800;">$RED5_HOME</span>/<span style="color: #007800;">$RED5_PROG</span>.<span style="color: #c20cb9; font-weight: bold;">sh</span> || <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">5</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
     start<span style="color: #7a0874; font-weight: bold;">&#41;</span>
         <span style="color: #7a0874; font-weight: bold;">echo</span> -n <span style="color: #ff0000;">&quot;Starting Red5&quot;</span>
         <span style="color: #7a0874; font-weight: bold;">echo</span> -n <span style="color: #ff0000;">&quot; &quot;</span>
         <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$RED5_HOME</span>
         <span style="color: #c20cb9; font-weight: bold;">su</span> -s /bin/bash -c <span style="color: #ff0000;">&quot;$RED5_HOME/$RED5_PROG.sh &amp;&quot;</span> <span style="color: #007800;">$RED5_USER</span>
         <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">2</span>
         ;;
     stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
         <span style="color: #7a0874; font-weight: bold;">echo</span> -n <span style="color: #ff0000;">&quot;Shutting down Red5&quot;</span>
         <span style="color: #7a0874; font-weight: bold;">echo</span> -n <span style="color: #ff0000;">&quot; &quot;</span>
         <span style="color: #c20cb9; font-weight: bold;">su</span> -s /bin/bash -c <span style="color: #ff0000;">&quot;killall -q -u $RED5_USER java&quot;</span> <span style="color: #007800;">$RED5_USER</span>
         <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">2</span>
         ;;
     restart<span style="color: #7a0874; font-weight: bold;">&#41;</span>
         $<span style="color: #000000;">0</span> stop
         $<span style="color: #000000;">0</span> start
         ;;
<span style="color: #000000; font-weight: bold;">esac</span></pre>
<p><br/><br />
Now you can start/stop/restart from the command line by using:<br />
<code>sudo /etc/init.d/red5 [start/stop/restart]</code></p>
<p>Lastly once you've got the server running, you can browse to the test page on your server <a href="http://localhost:5080">http://localhost:5080</a> and you should see:</p>
<p><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2011/03/red5-test-screen.png" alt="" title="red5-test-screen" width="580" height="390" class="aligncenter size-full wp-image-502" /></p>
<p>If you can't see this it and you've confirmed the Red5 server is running it could be a firewall issue. You may need to alter the IPTables on your machine but that's not going to be covered here.</p>
<p>Lastly we need to install the actual streaming application on our Red5 Server. Navigate to <a href="http://localhost:5080/installer/">http://localhost:5080/installer/</a>, select the oflaDemo and click Install.<br />
To test it installed correctly, navigate to <a href="http://localhost:5080/demos/ofla_demo.html">http://localhost:5080/demos/ofla_demo.html</a> (correct the server name in the top right) and hit connect. You should see a list of available videos and a green light in the top right.</p>
<p>Congratulations you're all up and running with a Red5 Server!</p>
<hr/>
<br/><br />
<strong>Sample Application</strong></p>
<p>The following class shows a very simple example of starting a streaming feed to the server and then streaming the same data back from the server into a Video object on the stage.</p>
<p>The fundamentals are very simple:</p>
<ul>
<li>Create a NetConnection object and connect to the server</li>
<li>Create a NetStream when the connection succeeds and publish the camera feed to the stream as a "record" type</li>
</ul>
<pre class="actionscript"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">package</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #0066CC;">NetConnection</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #0066CC;">NetStream</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">NetStatusEvent</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">media</span>.<span style="color: #0066CC;">Camera</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">media</span>.<span style="color: #0066CC;">Video</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Red5Experiment <span style="color: #0066CC;">extends</span> Sprite</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #808080; font-style: italic;">//</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #808080; font-style: italic;">//	Constants</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const RED5_URL	: <span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;rtmp://SERVERNAME/oflaDemo/test/&quot;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #808080; font-style: italic;">//</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #808080; font-style: italic;">//	Variables</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _netConnection	: <span style="color: #0066CC;">NetConnection</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _netStream		: <span style="color: #0066CC;">NetStream</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _recvStream		: <span style="color: #0066CC;">NetStream</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">_url</span>		: <span style="color: #0066CC;">String</span> = RED5_URL;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _filename		: <span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;test-red5&quot;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _video		: <span style="color: #0066CC;">Video</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Red5Experiment<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			_netConnection = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">NetConnection</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			_netConnection.<span style="color: #0066CC;">connect</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">_url</span> <span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			_netConnection.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> NetStatusEvent.<span style="color: #006600;">NET_STATUS</span>, netStatusHandler, <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>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			_video = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Video</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			addChild<span style="color: #66cc66;">&#40;</span> _video <span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #808080; font-style: italic;">////////////////////////////////////////////////////////</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #808080; font-style: italic;">//	FUNCTIONALITY</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #808080; font-style: italic;">//</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #808080; font-style: italic;">//</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #808080; font-style: italic;">//	Setup the camera</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #000000; font-weight: bold;">var</span> cam:<span style="color: #0066CC;">Camera</span> = <span style="color: #0066CC;">Camera</span>.<span style="color: #006600;">getCamera</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			cam.<span style="color: #006600;">setLoopback</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			cam.<span style="color: #0066CC;">setMode</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">176</span>,<span style="color: #cc66cc;">144</span>,<span style="color: #cc66cc;">15</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			cam.<span style="color: #006600;">setKeyFrameInterval</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			cam.<span style="color: #0066CC;">setQuality</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">70</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #808080; font-style: italic;">//</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #808080; font-style: italic;">//	Start publishing the video stream</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			_netStream = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">NetStream</span><span style="color: #66cc66;">&#40;</span>_netConnection<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			_netStream.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> NetStatusEvent.<span style="color: #006600;">NET_STATUS</span>, netStatusHandler, <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>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			_netStream.<span style="color: #006600;">attachCamera</span><span style="color: #66cc66;">&#40;</span> cam <span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			_netStream.<span style="color: #006600;">publish</span><span style="color: #66cc66;">&#40;</span>_filename, <span style="color: #ff0000;">&quot;record&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #808080; font-style: italic;">//</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #808080; font-style: italic;">//	Grab live stream back from server</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			_recvStream = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">NetStream</span><span style="color: #66cc66;">&#40;</span>_netConnection<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			_recvStream.<span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span>_filename<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			_video.<span style="color: #006600;">attachNetStream</span><span style="color: #66cc66;">&#40;</span>_recvStream<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #808080; font-style: italic;">//</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #808080; font-style: italic;">//	Alternatively, Use the local camera feed</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//			_video.attachCamera(cam);</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #808080; font-style: italic;">////////////////////////////////////////////////////////</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #808080; font-style: italic;">//	EVENT HANDLERS</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #808080; font-style: italic;">//</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> netStatusHandler<span style="color: #66cc66;">&#40;</span> event:NetStatusEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;Red5Experiment::netStatusHandler():&quot;</span>+event.<span style="color: #006600;">info</span>.<span style="color: #006600;">code</span> <span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">&#40;</span> event.<span style="color: #006600;">info</span>.<span style="color: #006600;">code</span> <span style="color: #66cc66;">&#41;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">				<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;NetConnection.Connect.Success&quot;</span>:</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">					<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">					<span style="color: #b1b100;">break</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li></ol></pre>
<p>The files are recorded to a directory within the webapps folder on your server. If you've followed the paths above you'll find the file <code>/usr/share/red5/webapps/oflaDemo/streams/test/test-red5.flv</code> on your server.</p>
<p>You now should have a complete streaming / recording media setup. All running off an open source server! </p>
<hr/>
<p>EDIT: I've created a zip of the sample application files: <a href='http://labs.distriqt.com/wordpress/wp-content/uploads/2011/05/red5_sampleapplication.zip'>red5_sampleapplication</a></p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://labs.distriqt.com/post/493"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://labs.distriqt.com/post/493/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>KML Interactions</title>
		<link>http://labs.distriqt.com/post/421</link>
		<comments>http://labs.distriqt.com/post/421#comments</comments>
		<pubDate>Mon, 04 Oct 2010 11:49:09 +0000</pubDate>
		<dc:creator>Michael Archbold</dc:creator>
				<category><![CDATA[experiments]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[google-maps]]></category>
		<category><![CDATA[interaction]]></category>
		<category><![CDATA[kml]]></category>

		<guid isPermaLink="false">http://labs.distriqt.com/?p=421</guid>
		<description><![CDATA[I've had a few requests asking about how to interact with the KML once you've loaded it onto the map. It's really quite an easy step once you've got the KML on there but I'll show you how in this simple example. Firstly if you haven't read the Simple KML Loader post then head over [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F421"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F421&amp;source=distriqt&amp;style=normal&amp;service=bit.ly&amp;service_api=R_d2c0f1a5509cd228ab0be545d628ad7a&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I've had a few requests asking about how to interact with the KML once you've loaded it onto the map. It's really quite an easy step once you've got the KML on there but I'll show you how in this simple example.</p>
<p><a href="http://labs.distriqt.com/examples/kmlloader/index.html" rel="shadowbox"><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2010/10/kml-interaction-example-580x332.png" alt="KML Interaction Example" title="KML Interaction Example" width="580" height="332" class="aligncenter size-medium wp-image-422" /></a><br />
<span id="more-421"></span><br />
Firstly if you haven't read the <a href="http://labs.distriqt.com/post/251">Simple KML Loader</a> post then head over there first. It explains how to get that KML file loaded and displayed on your map.</p>
<p>The objective of this simple example is to show an info window popup when we rollover one of the objects in the kml, showing the name of the kml object in the window.</p>
<p>The code for this example is in our svn:</p>
<p><code>svn co http://svn.distriqt.com/public/trunk/gmaps/examples/kmlloader/</code></p>
<p>Make sure you have our SimpleKmlLoader library in your project.</p>
<p>To create the loader, load the kml and have it added to your map:</p>
<pre class="actionscript"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> _loader:SimpleKmlLoader = <span style="color: #000000; font-weight: bold;">new</span> SimpleKmlLoader<span style="color: #66cc66;">&#40;</span> _map, <span style="color: #000000; font-weight: bold;">true</span> <span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">_loader.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> Event.<span style="color: #006600;">COMPLETE</span>, loader_completeHandler <span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">_loader.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span> _file <span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></pre>
<p>Now on the complete handler you can add the interactions:</p>
<pre class="actionscript"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">function</span> loader_completeHandler<span style="color: #66cc66;">&#40;</span> _event:Event <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #808080; font-style: italic;">// At this point generally this objects array</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #808080; font-style: italic;">//   will simply be the base object of the KML</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	addInteraction<span style="color: #66cc66;">&#40;</span> _loader.<span style="color: #006600;">objects</span> <span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp;* Add interaction to every object in the array</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp;*/</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">function</span> addInteraction<span style="color: #66cc66;">&#40;</span> _objects:<span style="color: #0066CC;">Array</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #b1b100;">for</span> each <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> _object:KmlDisplayObject <span style="color: #b1b100;">in</span> _objects<span style="color: #66cc66;">&#41;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		_object.<span style="color: #006600;">interactive</span> = <span style="color: #000000; font-weight: bold;">true</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		_object.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MapMouseEvent.<span style="color: #006600;">ROLL_OVER</span>, object_rollOverHandler, <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>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		_object.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MapMouseEvent.<span style="color: #006600;">ROLL_OUT</span>, object_rollOutHandler, <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>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #808080; font-style: italic;">// Process any children</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		addInteraction<span style="color: #66cc66;">&#40;</span> _object.<span style="color: #006600;">children</span> <span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">function</span> object_rollOverHandler<span style="color: #66cc66;">&#40;</span> _event:MapMouseEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #808080; font-style: italic;">// show an info panel...</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">var</span> _object:KmlDisplayObject = KmlDisplayObject<span style="color: #66cc66;">&#40;</span>_event.<span style="color: #006600;">currentTarget</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	_map.<span style="color: #006600;">openInfoWindow</span><span style="color: #66cc66;">&#40;</span> _object.<span style="color: #006600;">latLng</span>, <span style="color: #000000; font-weight: bold;">new</span> InfoWindowOptions<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>content:_object.<span style="color: #0066CC;">name</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">function</span> object_rollOutHandler<span style="color: #66cc66;">&#40;</span> _event:MapMouseEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	_map.<span style="color: #006600;">closeInfoWindow</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li></ol></pre>
<p>Now when you run with this code you should see the name of the kml object appear in the info window when you rollover the object. This is of course a very simple example, and much more can be done with this, but it is a good point to introduce the concept of interactions.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://labs.distriqt.com/post/421"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://labs.distriqt.com/post/421/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Nike+ AS3 Library</title>
		<link>http://labs.distriqt.com/post/388</link>
		<comments>http://labs.distriqt.com/post/388#comments</comments>
		<pubDate>Sun, 12 Sep 2010 07:24:44 +0000</pubDate>
		<dc:creator>Michael Archbold</dc:creator>
				<category><![CDATA[library]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[nike+]]></category>

		<guid isPermaLink="false">http://labs.distriqt.com/?p=388</guid>
		<description><![CDATA[Okay so I'm not the most athletic person in the world, but one thing that does get me out of the house is tracking how far I've been running. Watching the km's tick over! But I'm sick of iTunes and having to log into nike online all the time. So I got bored this weekend [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F388"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F388&amp;source=distriqt&amp;style=normal&amp;service=bit.ly&amp;service_api=R_d2c0f1a5509cd228ab0be545d628ad7a&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Okay so I'm not the most athletic person in the world, but one thing that does get me out of the house is tracking how far I've been running. Watching the km's tick over!</p>
<p><img src="http://labs.distriqt.com/wordpress/wp-content/uploads/2010/09/HR_hero-580x325.jpg" alt="" title="nike+ runners" width="580" height="325" class="aligncenter size-medium wp-image-400" /><br />
But I'm sick of iTunes and having to log into nike online all the time. So I got bored this weekend and the result is the start of a new little as3 interface using the content from my Nike+ device. Initially this library just processes files that nike+ stores on the device, but would eventually like it to access the online service as well.<br />
<span id="more-388"></span><br />
The <code>NikePlus</code> class represents the base of the Nike+ interface. With this interface you can load a series of workouts from their xml files and use the data stored therein for other applications.</p>
<p>The workouts are stored as xml files on the devices at a location similar to the below, (you may have to enable filesystem access in itunes to be able to see this):</p>
<p>[DEVICEMOUNTPOINT]/iPod_Control/Device/Trainer/Workouts/Empeds/[NIKEPLUSID]/</p>
<p>Underneath this directory the data is setup as follows:</p>
<ul>
<li>latest/*.xml	- A series of xml workout files that haven't been synced</li>
<li>synched/*.xml	- A series of xml workout files that have been synced</li>
<li>lastWorkout.xml	- The last xml workout file</li>
<li>preferences.xml	- Nike+ preferences xml file</li>
</ul>
<p>You can get the library here:<br />
<code>svn co http://svn.distriqt.com/public/trunk/nikeplus/trunk</code></p>
<p>Usage of the library is relatively simple at this stage:</p>
<pre class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> _nikeplus:NikePlus = <span style="color: #000000; font-weight: bold;">new</span> NikePlus<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
_nikeplus.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> NikePlus.<span style="color: #0066CC;">LOADED</span>, nikeplus_loadedHandler <span style="color: #66cc66;">&#41;</span>;
_nikeplus.<span style="color: #006600;">loadWorkout</span><span style="color: #66cc66;">&#40;</span> _workout_xml_location <span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>Then once loaded:</p>
<pre class="actionscript"><span style="color: #000000; font-weight: bold;">function</span> nikeplus_loadedHandler<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: #b1b100;">for</span> each <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> _workout:NikeWorkout <span style="color: #b1b100;">in</span> _nikeplus.<span style="color: #006600;">workouts</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> _workout.<span style="color: #006600;">summary</span>.<span style="color: #006600;">calories</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;Data Interval: &quot;</span>+_workout.<span style="color: #006600;">intervalValue</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>; i &lt; _workout.<span style="color: #0066CC;">data</span>.<span style="color: #0066CC;">length</span>; i++<span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;Data Point[&quot;</span>+i+<span style="color: #ff0000;">&quot;] &quot;</span>+_workout.<span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<p>Started building a simple little AIR application to eventually replace iTunes and Nike online. I'll post more when I have a working version.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://labs.distriqt.com/post/388"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://labs.distriqt.com/post/388/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

