<?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>Crickets Chirping &#187; flash</title>
	<atom:link href="http://www.cricketschirping.com/weblog/category/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cricketschirping.com/weblog</link>
	<description>mon qui si, mon qui d'où</description>
	<lastBuildDate>Fri, 02 Apr 2010 17:37:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Photo Booth In Flash, Without All the Flash Crap</title>
		<link>http://www.cricketschirping.com/weblog/2007/01/15/photo-booth-in-flash-without-all-the-flash-crap/</link>
		<comments>http://www.cricketschirping.com/weblog/2007/01/15/photo-booth-in-flash-without-all-the-flash-crap/#comments</comments>
		<pubDate>Tue, 16 Jan 2007 04:26:58 +0000</pubDate>
		<dc:creator>banksean</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://www.cricketschirping.com/weblog/?p=932</guid>
		<description><![CDATA[I got this idea for a web-based photo booth application (yeah yeah real original, I know) but the only practical way to access a camera from a browser-based app is through Flash. Now, I know databases, networks, application servers, frameworks of all kinds. If it&#8217;s code I&#8217;ve probably at least tinkered with it if not [...]]]></description>
			<content:encoded><![CDATA[<p>I got this idea for a web-based photo booth application (yeah yeah real original, I know) but the only practical way to access a camera from a browser-based app is through Flash.  </p>
<p>Now, I know databases, networks, application servers, frameworks of all kinds.  If it&#8217;s code I&#8217;ve probably at least tinkered with it if not built an app and got paid for it.   I take pride in my breadth of knowledge of all things programmery.</p>
<p>Except Flash.  </p>
<p>I wrote this long rant on how Flash programming sucks if you&#8217;re used to doing &#8220;Real&#8221; development because the tools are all jumbled up with this Movie metaphor and the tools are bulky and sclerotic.  </p>
<p>But then I deleted it because if I were you I&#8217;d skip past the ranting and look for the meat. </p>
<p>So here it is (you need to have a web cam in order for it to work):</p>
<p><a href="http://www.cricketschirping.com/flash/PhotoBooth1/PhotoBooth.html">Demo Page</a></p>
<p><a href="http://www.cricketschirping.com/flash/PhotoBooth1/FlashPhotoBooth1.zip">.zip of the source code</a></p>
<p>This is just the first baby step, so it doesn&#8217;t do anything besides show you the live image and if you hit the space bar it grabs the current frame and shows it to the right of the live video.  I&#8217;ll add more to it later but I figured if anybody else is looking for a basic starting point for a mostly actionscript-based flash app, this is pretty damn dependency-free and cruftless.</p>
<p>To build it you do need to have <a href="http://www.mtasc.org/">MTASC</a> and <a href="http://swfmill.org/">SWFMill</a> installed.  I wrote a brain dead build.sh script for my little project.  Oh sure I could do something complicated for the build using ant or <a href="http://www.unfitforprint.com/articles/2006/01/02/howto-develop-flash-on-mac-osx-with-rake-mtasc-swfmill-and-textmate">rake</a> but I&#8217;m lazy and this build.sh gratification was instant.</p>
<p>MTASC is an open-source flash compiler and SWFMill is used to bundle resources into a .swf file, which is what the web browser wants to load and run.</p>
<p>Here are some links I found helpful, since I haven&#8217;t found any good &#8220;ActionScript/Flash for People Who Have Been Spoiled by Decades of Using Real Development Tools&#8221; articles anywhere.  &#8220;Flash for Programmers&#8221; would be a good short name too.</p>
<p><a href="http://www.unfitforprint.com/articles/2006/01/02/howto-develop-flash-on-mac-osx-with-rake-mtasc-swfmill-and-textmate">HOWTO: Develop Flash on Mac OSX with Rake, MTASC, SWFMill and TextMate</a></p>
<p><a href="http://www.developpeur-web-paris.com/grand-mister/dotclear2/index.php/post/2005/10/06/6-swfmill-et-la-webcam">This post that&#8217;s in French but who cares since the code make sense</a>.</p>
<p><a href="http://www.adobe.com/devnet/flash/articles/webcam_motion_print.html">This article on capturing bitmap data from the web cam</a>.  Hint: BitmapData is why there&#8217;s a &#8220;-version 8&#8243; flag in my build script. </p>
<p><a href="http://www.flashcomguru.com/index.cfm/2006/7/31/snapshottersources">Snapshotter</a> is a very similar application with source code (.fla tho so I couldn&#8217;t make much sense of it) and a bunch of server side stuff that&#8217;s all in Cold Fusion.  </p>
<p><a href="http://simonwillison.net/2006/Mar/30/flash/">The comments here are helpful too</a>.</p>
<p>Things I have learned so far: </p>
<p>Somebody at Macromedia has a hard-on for MovieClips.  Fucking <b>everything</b> has to be goddamn movie clip to these people.  Seriously- need a button?  Make a movie clip of a button.  Need a background image?  Make a one-frame movie clip and loop it or whatever.  [shakes head]</p>
<p>Saying ActionScript is just like JavaScript is misleading.  DHTML apps have the Document Object Model, which is pretty well documented and widely implemented.  ActionScript apps have a &#8220;stage&#8221; and they feel lost and lonely without a big crusty IDE hanging around them with timelines for all their movie clips.</p>
<p>MTASC and SWFMill are really cool.  I didn&#8217;t have to pay a gazillion bucks to Adobe or use their bizarro tools.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cricketschirping.com/weblog/2007/01/15/photo-booth-in-flash-without-all-the-flash-crap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
