<?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>Metal Fish Eggs &#187; Carlo</title>
	<atom:link href="http://blog.zincroe.com/author/carlo/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.zincroe.com</link>
	<description>Ramblings from the team at zinc Roe</description>
	<lastBuildDate>Tue, 17 Jan 2012 21:48:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.6</generator>
		<item>
		<title>Mirrored Video Object in Flash</title>
		<link>http://blog.zincroe.com/2010/07/mirrored-video-object-in-flash/</link>
		<comments>http://blog.zincroe.com/2010/07/mirrored-video-object-in-flash/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 20:29:34 +0000</pubDate>
		<dc:creator>Carlo</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Experiments]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[mirror]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://blog.zincroe.com/?p=674</guid>
		<description><![CDATA[When using the webcam in your flash applications, it can be handy to flip the video object so it acts like a mirror. Many of the flash webcam demos out there does exactly this, usually by setting the scaleX property of the video object to -1. Unfortunately, because the registration point of the video object [...]]]></description>
			<content:encoded><![CDATA[<p>When using the webcam in your flash applications, it can be handy to flip the video object so it acts like a mirror. Many of the flash webcam demos out there does exactly this, usually by setting the scaleX property of the video object to -1. Unfortunately, because the registration point of the video object is set on the top left corner, setting the scaleX property to a negative value moves the display object like flipping a page in a book from right to left.</p>
<div id="attachment_675" class="wp-caption aligncenter" style="width: 478px"><a href="http://blog.zincroe.com/wp-content/uploads/2010/07/reg_point.jpg"><img src="http://blog.zincroe.com/wp-content/uploads/2010/07/reg_point.jpg" alt="Setting scaleX to -1 on a display object" title="Setting scaleX to -1 on a display object" width="468" height="257" class="size-full wp-image-675" /></a><p class="wp-caption-text">Setting scaleX to -1 on a display object</p></div>
<p>Of course, you can easily place the video object back to where it was by compensating for the flip and adding the video object&#8217;s width to it&#8217;s current x value. While this solution works for most applications, there is one annoying thing about this method. If you ever want to move the video object around the stage or play with it&#8217;s scaleX value, there&#8217;s going to be a lot of compensating going on and it can get messy quick depending on the complexity of your application.</p>
<p>So to make it easier, here&#8217;s a class that extends the Video object and adds a &#8220;flipped&#8221; property. I don&#8217;t think I need to explain what the property does, but the class overrides the x and scaleX properties of Video so that it takes care of all the positioning when flipping the display object. Check out the demo [webcam required]:</p>
<p><object id="MirrorDemo" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="align" value="middle" /><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#cccccc" /><param name="src" value="http://blog.zincroe.com/wp-content/uploads/2010/07/HardwareDetection.swf" /><param name="name" value="MirrorDemo" /><param name="allowfullscreen" value="false" /><embed id="MirrorDemo" type="application/x-shockwave-flash" width="550" height="400" src="http://blog.zincroe.com/wp-content/uploads/2010/07/HardwareDetection.swf" name="MirrorDemo" bgcolor="#cccccc" quality="high" allowfullscreen="false" allowscriptaccess="sameDomain" align="middle"></embed></object></p>
<p>Even when flipped, the x property always references the left side of the video object and the scaleX remains the same. Here&#8217;s the source: <a href='http://blog.zincroe.com/wp-content/uploads/2010/07/MirrorDemo.zip'>MirrorDemo.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zincroe.com/2010/07/mirrored-video-object-in-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Taking a look at Adobe Stratus</title>
		<link>http://blog.zincroe.com/2009/12/taking-a-look-at-adobe-stratus/</link>
		<comments>http://blog.zincroe.com/2009/12/taking-a-look-at-adobe-stratus/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 18:40:54 +0000</pubDate>
		<dc:creator>Carlo</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Experiments]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Peer2Peer]]></category>
		<category><![CDATA[RTMFP]]></category>
		<category><![CDATA[Stratus]]></category>

		<guid isPermaLink="false">http://blog.zincroe.com/?p=566</guid>
		<description><![CDATA[I had some time to take a look at what Adobe Labs has been up to and got caught up on Stratus. Stratus is a (currently free) service Adobe provides that enables peer 2 peer communication between multiple instances of the flash player. It uses RTMFP which you can learn more about on Adobe Labs. [...]]]></description>
			<content:encoded><![CDATA[<p>I had some time to take a look at what Adobe Labs has been up to and got caught up on <a href="http://labs.adobe.com/technologies/stratus/" target="_blank">Stratus</a>. Stratus is a (currently free) service Adobe provides that enables peer 2 peer communication between multiple instances of the flash player. It uses RTMFP which you can learn more about on Adobe Labs.</p>
<p>I have to admit, I didn&#8217;t expect it to be so easy to create a simple chat application using the service. But if you&#8217;ve ever played around with streaming anything in flash, the process is the same. Just to explain it quickly, you have to create a NetConnection instance that connects to the stratus service (rtmfp://stratus.adobe.com/[YOUR_DEVELOPER_KEY]). After a successful connection you will receive a unique id. You also need to create two NetStream instances, one for sending data and the other for receiving. Listeners added to these two streams will get invoked each time data is sent/received.</p>
<p>Here&#8217;s what I managed to put together in almost no time:<br />
<object id="SimpleChat" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="align" value="middle" /><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#cccccc" /><param name="src" value="http://blog.zincroe.com/wp-content/uploads/2009/12/SimpleChat.swf" /><param name="name" value="SimpleChat" /><param name="allowfullscreen" value="false" /><embed id="SimpleChat" type="application/x-shockwave-flash" width="550" height="400" src="http://blog.zincroe.com/wp-content/uploads/2009/12/SimpleChat.swf" name="SimpleChat" bgcolor="#cccccc" quality="high" allowfullscreen="false" allowscriptaccess="sameDomain" align="middle"></embed></object></p>
<p>To start chatting, exchange id&#8217;s with the person you want to chat with (through im or email, or if you&#8217;re lonely you can just open this page in a seperate window), paste their id in the &#8220;FRIEND&#8217;S ID&#8221; input and hit connect, both users must do this. Once you&#8217;re connected to each other, chat away!</p>
<p>Soo&#8230;why do I need to use this awesome chat application if i have to communicate my id through some other way? Well, first, this is just a demo of the Stratus service. And second, in a real world chat application, the id exchange should take place through some back-end code, maybe based on the user&#8217;s email address or something.</p>
<p>Unlike Flash Media Server or other similar technologies, RTMFP has very low latency making it ideal for use in video/audio chat, multiuser gaming, and other applications that are dependent on fast communication between multiple users.</p>
<p>Here&#8217;s a couple resources which I found really helpful:</p>
<p>Video tutorial: <a href="http://www.flashrealtime.com/tuts/p2p-in-flash.html" target="_blank">http://www.flashrealtime.com/tuts/p2p-in-flash.html</a></p>
<p>Text tutorial: <a href="http://www.insideria.com/2009/07/getting-started-with-adobe-str.html" target="_blank">http://www.insideria.com/2009/07/getting-started-with-adobe-str.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zincroe.com/2009/12/taking-a-look-at-adobe-stratus/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A World Of Wonders: Globequest</title>
		<link>http://blog.zincroe.com/2009/10/a-world-of-wonders-globequest/</link>
		<comments>http://blog.zincroe.com/2009/10/a-world-of-wonders-globequest/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 19:41:02 +0000</pubDate>
		<dc:creator>Carlo</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[A World Of Wonders]]></category>
		<category><![CDATA[Globequest]]></category>
		<category><![CDATA[WOW]]></category>

		<guid isPermaLink="false">http://blog.zincroe.com/?p=499</guid>
		<description><![CDATA[Zinc Roe &#38; TVO has just launched Globequest, a game that lets children (and adults) learn more about different places and cultures around the world! This is probably one of the bigger projects I had the opportunity to work on here at Zinc Roe, and I must say, it was an awesome experience. Not only [...]]]></description>
			<content:encoded><![CDATA[<p>Zinc Roe &amp; TVO has just launched <a title="Globequest" href="http://www.tvokids.com/framesets/play.html?game=255" target="_blank">Globequest</a>, a game that lets children (and adults) learn more about different places and cultures around the world!</p>
<p><a href="http://www.tvokids.com/framesets/play.html?game=255"><img class="aligncenter size-full wp-image-501" title="Globequest Screenshot" src="http://blog.zincroe.com/wp-content/uploads/2009/10/Untitled-11.jpg" alt="Globequest Screenshot" width="400" height="300" /></a></p>
<p>This is probably one of the bigger projects I had the opportunity to work on here at Zinc Roe, and I must say, it was an awesome experience. Not only did I learn more about code performance and optimization, I also learned that the word &#8220;Taiko&#8221; means &#8220;drum&#8221; in japanese!!!</p>
<p>Since a lot of the things that were done behind the scenes for this game were new to me, I decided to do a write up going through some coding challenges we had for creating the game.</p>
<p>Over at my blog post, you&#8217;ll read about how we dealt with the big bitmaps, managing multiple swf files, and different ways to display video with flash.</p>
<p>So let&#8217;s go! NEXT STOP =&gt; <a title="Carlo's Globequest post" href="http://labs.alducente.com/2009/10/12/globequest/" target="_self">Carlo&#8217;s Blog!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zincroe.com/2009/10/a-world-of-wonders-globequest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Motion &amp; Activity Tracking in Flash</title>
		<link>http://blog.zincroe.com/2009/07/motion-activity-tracking-in-flash/</link>
		<comments>http://blog.zincroe.com/2009/07/motion-activity-tracking-in-flash/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 15:28:08 +0000</pubDate>
		<dc:creator>Carlo</dc:creator>
				<category><![CDATA[Experiments]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Show and Tell]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.zincroe.com/?p=282</guid>
		<description><![CDATA[With the introduction of FLARToolkit and other means of tracking user input through a webcam in flash, I recently had a chance to read up on some of the other ways we can interact with flash applications using a webcam. Camera.activityLevel The most basic way to detect activity through a webcam in flash is by [...]]]></description>
			<content:encoded><![CDATA[<p>With the introduction of <em>FLARToolkit</em> and other means of tracking user input through a webcam in flash, I recently had a chance to read up on some of the other ways we can interact with flash applications using a webcam.</p>
<p><strong>Camera.activityLevel</strong></p>
<p>The most basic way to detect activity through a webcam in flash is by accessing the Camera object&#8217;s <em>activityLevel</em> property. This returns a number from 0 to 100, depending on how much activity is going on. While useful in simple applications, this doesn&#8217;t give us a way to check for specific gestures or a way to check a specific section of the video for activity.</p>
<p><strong>BitmapData.getPixel()</strong></p>
<p>A popular way to detect motion is by using the <em>BitmapData</em> object in flash. By taking &#8220;snapshots&#8221; of the video coming in from the webcam constantly (using either <em>Event.ENTER_FRAME</em>, or the <em>Timer</em> object), we end up with frames that we can compare by looping through each pixel and checking to see which has changed. This technique is useful for checking which areas of the video has activity. We can use it to interact with buttons or other display objects by simply waving our hand over it. Though it can be very intensive (specially when working with video that has large dimensions), it is one of the best and most reliable way to detect motion in flash.</p>
<p><strong>Augmented Reality &amp; Marker Tracking</strong></p>
<p>As mentioned earlier, another option is to use <a title="FLARToolkit" href="http://www.libspark.org/wiki/saqoosha/FLARToolKit/en" target="_blank">saqoosha&#8217;s FLARToolkit</a>. If you haven&#8217;t played with it before, you should definitely check it out&#8230;after reading my blog post to the end, of course. From what I understand (and correct me if I&#8217;m wrong), this neat library also uses the BitmapData object to take stills of the video from the webcam. It then manipulates the bitmaps in order to detect and extract the position of a marker in 3D space. You can then use flash 3D libraries like Papervision to apply those coordinates to a 3D object and display it on top of the marker as if it&#8217;s a physical object. This method requires the user to print out a specific symbol and display it in front of a webcam. The wicked thing about FLARToolkit is that it doesn&#8217;t restrict you to using just Papervision, you can use Away3D or no 3D at all!</p>
<p>Though it comes packaged with Papervision and Away3D, with a bit of &#8220;code spelunking&#8221;, you can strip out the 3D stuff and gain access to the marker&#8217;s x,y, and z properties. By doing this, you end up with a basic marker tracking library which you can use for pretty much anything your nerdy heart desires. In my case, my nerdy heart and I created a very basic game where you have to catch falling apples using only simple vector MovieClips. Check it out below:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/1Rc1rBC9rd4&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="340" src="http://www.youtube.com/v/1Rc1rBC9rd4&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><a href="http://blog.zincroe.com/wp-content/uploads/2009/07/FallingApples.zip">Download Source</a></p>
<p><strong>Moving MovieClips with your hand (or other limbs) using the webcam</strong></p>
<p>Now after playing with the BitmapData motion detection and the FLARToolkit, I went on a mission. A mission to find/figure out a way to interact with display objects on the stage using the webcam, BUT without using markers. After a bit of searching, I was able to find this <a title="Bubble Demo" href="http://www.youtube.com/watch?v=u8tGiV6M2qY&amp;feature=related" target="_blank">demo on youtube</a> which is close to what I want but with more control over the display object&#8217;s reaction.</p>
<p>Using what I&#8217;ve learned, and some inspiration from the youtube demo, I threw a quick example together as a learning exercise for myself. By checking for activity where our &#8220;box&#8221; movieclip is located, we can check which side has the most activity and move the box in the proper direction as if it&#8217;s a physical box you can push around. Though it&#8217;s not perfect and could DEFINITELY use some more code optimization, I was very satisfied with the result.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/mBNhxPyJs6I&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="340" src="http://www.youtube.com/v/mBNhxPyJs6I&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><a href="http://blog.zincroe.com/wp-content/uploads/2009/07/MotionDetect.zip">Download Source</a></p>
<p><strong>AS3 Real-Time Face Detection</strong></p>
<p>Another technique worth mentioning is face detection in flash. Here&#8217;s a snippet taken from <a title="AS3 Face Detection" href="http://www.quasimondo.com/archives/000687.php" target="_blank">Mario Klingemann&#8217;s blog</a> about the subject:</p>
<blockquote><p><em>&#8220;Yesterday Seb-Lee Delisle pointed us via Twitter to this great example of a Flash based real-time face detection. It turns out that already more than half a year ago Ohtsuka Masakazu had been porting the face detection part of OpenCV to AS3 and added the source code to the Spark project &#8211; which is like a Actionscript candy box full of surprises.&#8221;</em></p></blockquote>
<p>He then explains how it works and how to optimize it, it&#8217;s a good read for those interested in the subject.</p>
<p>So there you have it, we went from detecting basic general webcam activity in flash to complex face detection algorithms. Big kudos to the folks mentioned in this post as they&#8217;ve put in many hours coding in order for the rest of us to create awesome and engaging content with ease.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zincroe.com/2009/07/motion-activity-tracking-in-flash/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

