<?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>marchawkins.com &#187; Site News</title>
	<atom:link href="http://www.marchawkins.com/category/site-news/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marchawkins.com</link>
	<description>where to go when you can’t get enough of me</description>
	<lastBuildDate>Sun, 25 Jul 2010 09:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Capture and upload a webcam still with Flash</title>
		<link>http://www.marchawkins.com/2010/03/17/capture-and-upload-a-webcam-still-with-flash/</link>
		<comments>http://www.marchawkins.com/2010/03/17/capture-and-upload-a-webcam-still-with-flash/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 02:45:09 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[Site News]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://www.marchawkins.com/?p=162</guid>
		<description><![CDATA[Ok, so it&#8217;s not just Flash, but a combination of Flash, PHP, html and (in my case) some javascript. You can see this in action on my Say Cheese page. As I say on that page, this project was directly inspired by Brendan&#8217;s Dawes&#8217;s Say Hello feature on his website. I fell in love with [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.marchawkins.com/wp-content/uploads/2010/03/1268766802-450700704-cam.jpg"><img class="alignright size-medium wp-image-165" title="Capture a webcam in Flash" src="http://www.marchawkins.com/wp-content/uploads/2010/03/1268766802-450700704-cam-300x225.jpg" alt="Capture a webcam in Flash" width="300" height="225" /></a>Ok, so it&#8217;s not just Flash, but a combination of Flash, PHP, html and (in my case) some javascript. You can see this in action on my <a title="Say Cheese" href="http://www.marchawkins.com/say-cheese/" target="_self">Say Cheese</a> page. As I say on that page, this project was directly inspired by Brendan&#8217;s Dawes&#8217;s <a title="Brendan Dawes's Say Hello" href="http://www.brendandawes.com/say-hello/visitors" target="_blank">Say Hello</a> feature on his <a title="Brendan Dawes" href="http://www.brendandawes.com/" target="_blank">website</a>. I fell in love with the concept the first time I saw it and wanted to recreate it for this site &#8211; mainly as a learning experience, and I had a couple of enhancements I wanted to try.</p>
<p>Here&#8217;s how it works (assuming the user has a webcam):</p>
<ol>
<li> User visits the page and sees a &#8220;Take a shot&#8230;&#8221; link, along with a gallery of previously submitted photos. In my case, this is a db query that pulls back all the photos, ordered by date.</li>
<li>Clicking &#8220;Take a shot&#8230;&#8221; uses jQuery to slide a Flash app into view where the user is asked to allow Flash to communicate with their webcam.</li>
<li>Clicking &#8220;allow&#8221; shows a live feed from the user&#8217;s webcam. Click &#8220;snap&#8221; and a preview of the captured image is shown next to the live feed. Click &#8220;save&#8221; to upload the photo or &#8220;snap&#8221; again to preview a new shot.</li>
<li>The saved image is uploaded to the server and then its filename and timestamp are recorded to the database. I also have the script email me letting me know someone&#8217;s uploaded a photo.</li>
<li>Next jQuery hides the capture app, then uses ajax to fetch the latest photo from the database and write it to the gallery.</li>
</ol>
<p>Sounds more complicated than it is. There are several pieces working together, but I&#8217;ve tried to comment the code as best as I could. It basically just involves changing the server paths and the references to each file.</p>
<p>A quick rundown of the components in the zip file*:</p>
<ul>
<li> <strong>cam-capture.fla: </strong>The flash file to create the swf. You only need to change the path to the jpg-encode-db.php</li>
<li><strong>jpg-encod-db.php:</strong> The php script that takes the image data from the swf, creates a jpg, saves it to the server and records the entry in the database (and sends an email)</li>
<li><strong>say-cheese-loader.php:</strong> The php script called via ajax from your html page. It retrieves the latest photo from the database and returns a snippet of html to embed on the page.</li>
<li><strong>say-cheese.php:</strong> The html/php page containing the embedded swf. It contains all the javascript &#8211; to toggle the display of the swf and to call the say-cheese-loader.php (which retrieves the latest photo and outputs some html to update the gallery)</li>
</ul>
<p>So there you have it. Drop a comment on this page if you get it running on your site or have any additions to the code. Looking forward to seeing your enhancements.</p>
<p><em>*Important: for the jpeg encoding, you will need to </em><a title="Get the as3corelib Library" href="http://code.google.com/p/as3corelib/" target="_blank"><em>download the as3corelib</em></a><em> library from its Google code repository. See the <a title="as3corelib Project Homepage" href="http://code.google.com/p/as3corelib/" target="_blank">project site</a></em><em> for details. The code in the fla imports this in the first line of the actionscript in the &#8216;actions&#8217; layer.</em></p>
<p><a title="Download File" href="/downloads/Cam-Capture-Files.zip">Download Cam-Capture-Files.zip</a> (14k)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marchawkins.com/2010/03/17/capture-and-upload-a-webcam-still-with-flash/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Posting from the iPhone</title>
		<link>http://www.marchawkins.com/2010/01/31/posting-from-the-iphone/</link>
		<comments>http://www.marchawkins.com/2010/01/31/posting-from-the-iphone/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 21:58:51 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[Site News]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.marchawkins.com/2010/01/31/posting-from-the-iphone/</guid>
		<description><![CDATA[Trying out a post from the iPhone. Obviously not an ideal platform for composing long posts, but handy to have the capability nonetheless. Couldn&#8217;t connect the app to my blog a couple of months ago, but it seems to be working now. Hooray for progress.]]></description>
			<content:encoded><![CDATA[<p>Trying out a post from the iPhone. Obviously not an ideal platform for composing long posts, but handy to have the capability nonetheless. Couldn&#8217;t connect the app to my blog a couple of months ago, but it seems to be working now. Hooray for progress.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marchawkins.com/2010/01/31/posting-from-the-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress: Take 7</title>
		<link>http://www.marchawkins.com/2010/01/29/wordpress-take-7/</link>
		<comments>http://www.marchawkins.com/2010/01/29/wordpress-take-7/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 06:15:00 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[Site News]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.marchawkins.com/?p=7</guid>
		<description><![CDATA[Once again, I&#8217;ve decided to install WordPress as the de facto CMS for this website. I&#8217;ve set it up on a number of sites recently and am really enjoying the advancements in the admin interface over the past couple of versions. I&#8217;ve also just signed up for a posterous account, so I&#8217;ve got some planning to [...]]]></description>
			<content:encoded><![CDATA[<p>Once again, I&#8217;ve decided to install WordPress as the de facto CMS for this website. I&#8217;ve set it up on a number of sites recently and am really enjoying the advancements in the admin interface over the past couple of versions. I&#8217;ve also just signed up for a <a title="check out my posterous account" href="http://marchawkins.posterous.com/" target="_blank">posterous account</a>, so I&#8217;ve got some planning to do as far as how these two services can interact (integrate?).</p>
<p>Surprisingly, this latest version also seems to be running a little faster than the last couple releases. That could just be my imagination. I still can&#8217;t tell if I&#8217;ve f&#8217;d up my server by mucking around with php.ini files and such. Time will tell, I guess.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marchawkins.com/2010/01/29/wordpress-take-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
