DailyJS

Gordon: A Flash JavaScript Runtime

Alex R. Young

Subscribe

@dailyjs

Facebook

Google+

bbc glow tutorials

Gordon: A Flash JavaScript Runtime

Posted by Alex R. Young on .
Featured

bbc glow tutorials

Gordon: A Flash JavaScript Runtime

Posted by Alex R. Young on .

Gordon is a Flash JavaScript runtime written by Tobey Tailor. It currently supports the SWF 3 action
model, which means it doesn't yet support ActionScript Virtual Machine 2
(introduced by Flash 9). Tobey said a future version of Gordon will have ActionScript Virtual Machine 2 support (read more on Twitter:
@tobeytailor).

Gordon parses the SWF file and then draws using SVG and JavaScript. It
works well in Firefox and Safari, which also means it works on the
iPhone.

There are some demos on
paulirish.com/work/gordon/demos that illustrate SVG support and animation.

Usage looks like this:

new Gordon.Movie('trip.swf', {id: 'stage', width: 500, height: 400})

One thing I found interesting about Gordon is how it handles SWF file
decoding. Tobey uses a zip library in
inflate.js (written by Masanao Izumo) to decompress the file from a URL, then parse it.