Tag Archives: Flash

How to use ExternalInterface to integrate AS3 with JavaScript

Here’s a quick snippet of code for setting up intercommunication between a SWF and JavaScript, using ExternalInterface:


 

Synchronising animation across multiple player instances

I’ve been asked a few times how to create effects that require multiple instances of the Flash Player on a page to remain ‘in sync’, even with user interaction. Reading and writing to cookies frequently is inefficient and resource heavy. Also, when you have more than 2 SWFs, deciding which SWF updates who becomes tricky – especially if someone decides to change or remove an instance, or an instance which you picked as ‘master’ is not loaded, for some reason.


 

So, I came up with this solution, using LocalConnection with a twist, which works pretty well. But, if anyone has a better method, drop it in a comment below 🙂

Webcam controlled motion

I started playing around a little more with my Webcam and extended my previous 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, Pants3D 🙂

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:

FreeYourBuddy Web game

FreeYourBuddy.comFreeYourBuddy is a video-based ‘advergame’ I produced for GT/VML for a Windows Mobile campaign. It’s a lot like Subservient Chicken, but you need to chat to Buddy and direct him to solve puzzles in order to escape the confines of the computer in which he’s trapped. Continue reading FreeYourBuddy Web game

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 – you can grab and drag the grey blobs…

Fun with noisy filters

I’ve been playing with animating perlin noise and using it at a displacement map. Here’s a little example of what I mean (source).

Webcam motion detection in AS3

I converted the old webcam motion detection thing to AS3 today. Not that it improves the performance much, just wanted to play around with it (source).