<?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>Dino 2.0 &#187; Flash AS2</title>
	<atom:link href="http://www.dino.co.uk/labs/category/flash-experiments/as2-experiments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dino.co.uk/labs</link>
	<description>Better out than in...</description>
	<lastBuildDate>Sat, 04 Feb 2012 22:55:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>How many days until Christmas? Here&#8217;s a timer&#8230;</title>
		<link>http://www.dino.co.uk/labs/2011/christmas_countdown_timer/</link>
		<comments>http://www.dino.co.uk/labs/2011/christmas_countdown_timer/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 16:25:21 +0000</pubDate>
		<dc:creator>Dino</dc:creator>
				<category><![CDATA[Flash AS2]]></category>
		<category><![CDATA[Flash Experiments]]></category>
		<category><![CDATA[2011]]></category>
		<category><![CDATA[2012]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[Christmas]]></category>
		<category><![CDATA[countdown]]></category>
		<category><![CDATA[counter]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[timer]]></category>

		<guid isPermaLink="false">http://www.dino.co.uk/labs/?p=910</guid>
		<description><![CDATA[
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_countdown_19117944"
			class="flashmovie"
			width="450"
			height="307">
	<param name="movie" value="http://www.dino.co.uk/random/countdown/countdown.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.dino.co.uk/random/countdown/countdown.swf"
			name="fm_countdown_19117944"
			width="450"
			height="307">
	<!--<![endif]-->
		 
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object> I created this little puppy a while back, maybe 2004. Just found it on my hard drive and thought I&#8217;d add a post with it in. It dynamically updates the stats based on daily averages I set up at the beginning. It also takes the year from [...]]]></description>
			<content:encoded><![CDATA[
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_countdown_1945547966"
			class="flashmovie"
			width="450"
			height="307">
	<param name="movie" value="http://www.dino.co.uk/random/countdown/countdown.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.dino.co.uk/random/countdown/countdown.swf"
			name="fm_countdown_1945547966"
			width="450"
			height="307">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>I created this little puppy a while back, maybe 2004. Just found it on my hard drive and thought I&#8217;d add a post with it in. It dynamically updates the stats based on daily averages I set up at the beginning. It also takes the year from the current system clock, so should just tick over into the next year on New Year. The bit in-between will go a bit strange, but I&#8217;m not that fussed about fixing it. Feel free to do it yourself.</p>
<p>The source is <a href="http://www.dino.co.uk/random/countdown/countdown_fla.zip">here</a>, but it&#8217;s a bit old skool. It&#8217;ll give you a few ideas though if you&#8217;re brave enough to open it. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.dino.co.uk/labs/2011/christmas_countdown_timer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Do Penguins use Flash AS2?</title>
		<link>http://www.dino.co.uk/labs/2010/do-penguins-use-flash_as2/</link>
		<comments>http://www.dino.co.uk/labs/2010/do-penguins-use-flash_as2/#comments</comments>
		<pubDate>Tue, 14 Sep 2010 14:47:03 +0000</pubDate>
		<dc:creator>Dino</dc:creator>
				<category><![CDATA[Flash AS2]]></category>
		<category><![CDATA[Flash AS3]]></category>
		<category><![CDATA[Musings]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[as2]]></category>
		<category><![CDATA[Club Penguin]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[penguin]]></category>

		<guid isPermaLink="false">http://www.dino.co.uk/labs/?p=719</guid>
		<description><![CDATA[Looks like those penguins down at Club Penguin are being put to good use. Just noticed this little Easter egg&#8230; Go to the homepage of Club Penguin, click Play Now and zoom into the lower part of the screen (expand your browser window). Looks like they are using AS2 though&#8230; god help us when they [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" title="Club Penguin Actionscript" src="http://www.dino.co.uk/labs/wp-content/uploads/2010/09/cp_code450.jpg" alt="" width="450" height="299" /></p>
<p>Looks like those penguins down at <a href="http://www.clubpenguin.com/" target="_blank">Club Penguin</a> are being put to good use. Just noticed this little Easter egg&#8230; Go to the homepage of Club Penguin, click <a href="http://play.clubpenguin.com/index.php?lang=en" target="_blank">Play Now </a>and zoom into the lower part of the screen (expand your browser window). Looks like they are using AS2 though&#8230; god help us when they figure out HTML5! Still, I assume they are working on <a href="http://www.linux.org/" target="_blank">Linux</a> :)</p>
<p><img class="alignnone" title="Club Penguin code" src="http://www.dino.co.uk/labs/wp-content/uploads/2010/09/co_code_close.jpg" alt="" width="450" height="284" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dino.co.uk/labs/2010/do-penguins-use-flash_as2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Stitched up by my own webcam!</title>
		<link>http://www.dino.co.uk/labs/2009/stitched-up-by-my-own-webcam/</link>
		<comments>http://www.dino.co.uk/labs/2009/stitched-up-by-my-own-webcam/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 02:11:41 +0000</pubDate>
		<dc:creator>Dino</dc:creator>
				<category><![CDATA[Flash AS2]]></category>
		<category><![CDATA[cool]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[experiment]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://www.dino.co.uk/labs/?p=319</guid>
		<description><![CDATA[Another strange webcam experiment! Click the image to launch it. I take the raw cam feed, find what changes between frames and add a threshold filter to colour the bits that change to a solid red. I then simply loop through the pixels to see if any are red then use the pixel position to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.dino.co.uk/blogbox/flash/webcam_string/webcam_string2.swf"><img class="alignnone" title="Webcam String" src="http://www.dino.co.uk/blogbox/flash/webcam_string/webcam_string.jpg" alt="" width="450" height="298" /></a></p>
<p>Another strange webcam experiment! Click the image to <a href="http://www.dino.co.uk/blogbox/flash/webcam_string/webcam_string2.swf" target="_blank">launch it</a>.</p>
<p>I take the raw cam feed, find what changes between frames and add a threshold filter to colour the bits that change to a solid red. I then simply loop through the pixels to see if any are red then use the pixel position to draw lines to and from, sampling the original image to get the correct line colour. Completely no use to anyone&#8230; but looks nice enough.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dino.co.uk/labs/2009/stitched-up-by-my-own-webcam/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A simple Flash 3D engine from my past&#8230;</title>
		<link>http://www.dino.co.uk/labs/2009/a-simple-flash-3d-engine-from-my-past/</link>
		<comments>http://www.dino.co.uk/labs/2009/a-simple-flash-3d-engine-from-my-past/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 01:50:08 +0000</pubDate>
		<dc:creator>Dino</dc:creator>
				<category><![CDATA[Flash AS2]]></category>
		<category><![CDATA[Flash Experiments]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[as2]]></category>
		<category><![CDATA[engine]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://www.dino.co.uk/labs/?p=286</guid>
		<description><![CDATA[Just trawling through a few old Flash folders on my mac and found this little fella&#8217; sitting there all unloved. Came up with the 3D engine in 1998 using Director and made a quick hack to get it into Flash. It&#8217;s not particularly neat, hence why there&#8217;s no source posted, but suffice to say the [...]]]></description>
			<content:encoded><![CDATA[<p>Just trawling through a few old Flash folders on my mac and found this little fella&#8217; sitting there all unloved. Came up with the 3D engine in 1998 using Director and made a quick hack to get it into Flash. It&#8217;s not particularly neat, hence why there&#8217;s no source posted, but suffice to say the heart of he 3D bit is that old &#8216;fake-doodle-dandy&#8217; equation&#8230;</p>
<p><strong><em>var x = (worldLens*pointX)/(pointZ+worldScale)+xOffset;<br />
var y = (worldLens*pointY)/(pointZ+worldScale)+yOffset;</em></strong></p>
<p>Like so&#8230;</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="450" height="337" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="swliveconnect" value="true" /><param name="src" value="http://www.dino.co.uk/blogbox/random/3d_flash_balls/dino_3d_vid balls.swf" /><embed type="application/x-shockwave-flash" width="450" height="337" src="http://www.dino.co.uk/blogbox/random/3d_flash_balls/dino_3d_vid balls.swf" swliveconnect="true"></embed></object></p>
<p>Launch it to <a href="http://www.dino.co.uk/blogbox/random/3d_flash_balls/dino_3d_vid%20balls.swf" target="_blank">fill the browser</a></p>
<p>If you really want the code, let me know, but I&#8217;m secretly ashamed of it&#8230; :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dino.co.uk/labs/2009/a-simple-flash-3d-engine-from-my-past/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Webcam background removal in Flash</title>
		<link>http://www.dino.co.uk/labs/2008/webcam-background-removal-in-flash/</link>
		<comments>http://www.dino.co.uk/labs/2008/webcam-background-removal-in-flash/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 03:32:13 +0000</pubDate>
		<dc:creator>Dino</dc:creator>
				<category><![CDATA[Flash AS2]]></category>
		<category><![CDATA[as2]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[bitmapData]]></category>
		<category><![CDATA[experiment]]></category>
		<category><![CDATA[filters]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[removal]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://www.dino.co.uk/labs/?p=231</guid>
		<description><![CDATA[If you&#8217;re a fan of the EyeToy or you&#8217;ve just got You&#8217;re In the Movies on Xbox 360, you&#8217;ll know what this is all about. How to remove yourself from a web cam image and superimpose you on another background. The mighty Jop had a bit of a testbed working and I thought I&#8217;d get [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re a fan of the EyeToy or you&#8217;ve just got You&#8217;re In the Movies on Xbox 360, you&#8217;ll know what this is all about. How to remove yourself from a web cam image and superimpose you on another background.</p>
<p>The mighty <a href="http://www.interactionfigure.nl/" target="_blank">Jop</a> had a bit of a testbed working and I thought I&#8217;d get the old brain working again and have a tinker. It&#8217;s not pretty code but it&#8217;s available below if you&#8217;re interested in a few pointers. It&#8217;s also not that good, but if it inspires you to do it better (I.e. properly) then it&#8217;s done its job.</p>
<p>If the web cam doesn&#8217;t initailise. Try this <a href="http://www.dino.co.uk/blogbox/flash/webcam_removal/index.html" target="_blank">link</a>:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="450" height="221" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="swliveconnect" value="true" /><param name="src" value="http://www.dino.co.uk/blogbox/flash/webcam_removal/webcam_subtract.swf" /><embed type="application/x-shockwave-flash" width="450" height="221" src="http://www.dino.co.uk/blogbox/flash/webcam_removal/webcam_subtract.swf" swliveconnect="true"></embed></object></p>
<p>In a nutshell:</p>
<p>1: Grab camera feed</p>
<p>2: Take a snap of the background</p>
<p>3: Use a &#8216;difference&#8217; filter on them both to fighure out which pixels have changed the most</p>
<p>4: Use a &#8216;threshold&#8217; filter to remove all the pixels that haven&#8217;t changed much</p>
<p>5: ColourTransform the resulting pixels to black</p>
<p>6: Apply a slight blur to help make it less jagged</p>
<p>7: Cache the resulting image as a bitmap (so it can be used as a mask) and put it over a copy of the live feed</p>
<p>8: Cache the live feed as a bitmap and apply the mask</p>
<p>9: And repeat using an interval or similar</p>
<p>Here&#8217;s the main function:</p>
<p><em>function takeSnapshot() {<br />
<span style="color: #0000ff;"> //grab the cam and render it into a snapshot bitmapData obj</span><br />
snapshot.draw(output_vid);<br />
}</em></p>
<p><em>function checkVid() {<br />
<span style="color: #0000ff;">//grab live cam</span><br />
liveData.draw(output_vid);<br />
</em><em> <span style="color: #0000ff;">// grab snapshot</span><br />
</em><em>maskData.draw(snapshot);<br />
<span style="color: #0000ff;">// apply difference to 2 images</span><br />
maskData.draw(liveData, new Matrix(), new ColorTransform(), &#8216;difference&#8217;);<br />
<span style="color: #0000ff;">// remove all unchanged pixels. Make them transparent</span><br />
maskData.threshold(maskData, new Rectangle(0, 0, output_vid.width, output_vid.height), new Point(0, 0), &#8220;&lt;=&#8221;, (threshVal/100)*0x00ffffff, 0&#215;00000000, 0x00ffffff, true);<br />
<span style="color: #0000ff;">// colour what&#8217;s left black</span><br />
maskData.draw(maskData, new Matrix(), new ColorTransform(0, 0, 0, 1, 0, 0, 0, 0))<br />
<span style="color: #0000ff;">// Blur to improve quality</span><br />
maskData.applyFilter(maskData, maskData.rectangle, new Point(0, 0), blurFiltr);<br />
resultData.draw(liveData);<br />
<span style="color: #0000ff;">// cache the resulting mask and apply it to the live feed</span><br />
mask_mc.cacheAsBitmap = result_mc.cacheAsBitmap = true;<br />
result_mc.setMask(mask_mc);</em></p>
<p><em>}</em></p>
<p>Source is <a href="http://www.dino.co.uk/blogbox/flash/webcam_removal/webcam_subtract.zip" target="_blank">here</a>. Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dino.co.uk/labs/2008/webcam-background-removal-in-flash/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

