Archive for the 'Flash' Category

When design goes wrong

You know the situation - a designer has given you an FLA file to build from and either the text is too small to be legible for us mere mortals, or is going to be too large when translated into Russian. Since designers rarely think of these things, I find myself either coding in text size dynamically, or using these couple of of JSFL scripts I wrote a lot. One of them increases the point size of all text in an FLA, the other reduces it.

Webcam controlled motion

I started playing around a little more with my webcam and extended my previous webcam motion detection example - this time to control the camera of a virtual 3-D space from motion detected in the user’s webcam. It detects motion area and general direction, albeit with dubious accuracy, but you get the idea.

Due to popular demand, I’ve posted the source code for you lot to play with. It contains the FlashDevelop project file (it’s compiled with the flex 3 sdk) and my cut-down 3-D engine, Pant3D :)

Webcam Flames

I played around some more with my webcam today and knocked this out. I also found my webcam already has the IR filter missing (cheap webcam), so it can already see infrared… which will come in handy:

Wii Paint

After getting my Wii remote hooked up with the WiiFlash Server, I knocked up this quick Flash demo which draws the blobs of infrared light the Wii remote detects (it can track up to 4 blobs at once), just like the Wii console's sensitivity setting dialog does. I just gave each blob a different colour and clear the graphics on pressing the 'A' button.

Here's the code to get it working - requires WiiFlash Server:

import org.wiiflash.Wiimote;
import org.wiiflash.IR;
import org.wiiflash.events.ButtonEvent;
import org.wiiflash.events.WiimoteEvent;
import flash.events.*;

var myWiimote:Wiimote = new Wiimote();
myWiimote.connect();myWiimote.addEventListener(WiimoteEvent.UPDATE, onUpdated);
myWiimote.addEventListener(ButtonEvent.A_PRESS, onAPressed);

function onUpdated (pEvt:WiimoteEvent):void {
var ir:IR = pEvt.target.ir;
var irWidth:Number = 400;
var irHeight:Number = 400;
var irSize:Number = 4;
if (ir.p1) drawCircle(ir.x1*irWidth, ir.y1*irHeight, ir.size1*irSize, 0xff0000);
if (ir.p2) drawCircle(ir.x2*irWidth, ir.y2*irHeight, ir.size2*irSize, 0x00ff00);
if (ir.p3) drawCircle(ir.x3*irWidth, ir.y3*irHeight, ir.size3*irSize, 0x0000ff);
if (ir.p4) drawCircle(ir.x4*irWidth, ir.y4*irHeight, ir.size4*irSize, 0xffff00);
}

function onAPressed (pEvt:ButtonEvent):void {
graphics.clear();
pEvt.target.rumbleTimeout = 50;
}

function drawCircle (x:Number, y:Number, size:Number, colour:Number=0xffffff):void {
graphics.beginFill(colour, .2);
graphics.drawCircle(x,y,size);
}

Quick as a Flash?

I missed this when it was published, but Tinic Uro, an Adobe Flash Player engineer, published an interesting article on exactly why framerates in Flash Player are so damn unreliable - seems it's not just about our shoddy code :)

Revenge of Dinky Bomb

Back in 2002 some colleagues and I built one of the web's most popular online multi-user Flash games, Dinky Bomb. It's since been acquired by Atari and I thought no footage of it existed, other than a bit of a TV show in which it was featured. YouTube to the rescue...

FreeYourBuddy.com launched

FreeYourBuddy.comI just finished developing this video-based viral game site thing at GT for Windows Mobile. It's a bit like Subservient Chicken, but you need to talk to Buddy and direct him to solve puzzles in order to escape the confines of the computer in which he's trapped.

You can tell him to do silly stuff too - or just swear at him like I do - whatever floats ya boat.

Mercedes Bendz

Mercedes Bend BannerI feel slightly dirty, having not only done some work for an oil company recently, but also just having made a banner. I usually tell clients that banners are against my religion, but made an exception in this case because it involved doing some challenging code-driven animation. Check it out on Bannerblog.

Wobbly springy physics

I recently needed to create something where a chain of spring dynamics points is connected with one smooth, seamless curve. After much mathematical wrangling, here's the result of my efforts...

Flash 10 sneak peek

Adobe shows off some of the eagerly-awaited new features of Flash 10 - coded-named Astro: