Web Based Photo Booth
Friday, May 14th, 2010I was playing with Photo Booth on my laptop the other night and decided to see if I could make something similar. I gave it a shot and it came out pretty good for a quick prototype.
I was playing with Photo Booth on my laptop the other night and decided to see if I could make something similar. I gave it a shot and it came out pretty good for a quick prototype.
So one night not too long ago I was sitting on my couch interneting and I started playing with search.twitter.com looking at the mass amounts of people posting photos to Twitter via Twitpic . I found the amount of photos getting uploaded astounding, at times close to 10 photos a second. But with that many photos getting posted every second its hard to visually comprehend, so I came up with an idea for an app, WHAM, Twitpic-viewer was conceived.
So using the Twitter API, I run a search for “twitpic.com”, return some JSON, parse it and loadin the photos.
I think it works pretty well, it is kinda like a train wreck though, you just can’t look away. Also be aware I don’t control the content, so odds are you will some nudity and other questionable content, enjoy!
*I currently DO NOT limit how many images will be loaded in, so eventually it will crash your browser if you let it run long enough.
** joekromer.com is in no way affilated with twitpic.com
*** for those interested here is the source for twitpic-viewer.
When making the switch to AS3 there are all kinds of problems we run into, one that I seem to deal with on a daily basis is navigating to a URL.
Back in AS2 it looked like this:
getURL("http://www.joekromer.com", "_self");
AS3 it looks like this:
var URLReq:URLRequest = new URLRequest("http://www.joekromer.com");
try {
navigateToURL(URLReq, "_self");
} catch (e:Error) {
trace(e);
}
So I decided I was going to write a quick little class to make my life just a little bit easier. Now after you include my Navigate class all you have to do is call “Navigate.to()”. Of course you need to pass the URL to the function. The function also defaults the target to “_self”, but that can be changed by including whatever target you want.
The code in my class looks like this:
package com.joekromer{
import flash.net.URLRequest;
import flash.net.navigateToURL;
public class Navigate{
public function Navigate(url:String, target:String) {
var URLReq:URLRequest = new URLRequest(url);
try {
navigateToURL(URLReq, target);
} catch (e:Error) {
trace("Oh noes you broke it = " + e);
}
}
public static function to(url:String, target:String = "_self"):Navigate {
return new Navigate(url, target);
}
}
}
With my class you can navigate to a url like this:
import com.joekromer.Navigate;
Navigate.to("http://www.joekromer.com", "_blank");
Happy Flashing.