Category Archives: JavaScript

Be a DJedi

I created a little YouTube party mixer, complete with a crossfader and ‘automix’ capability – for all you budding bar DJs. It uses the YouTube Data API and a whole lot of JavaScript. Continue reading Be a DJedi


 

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:

import flash.external.ExternalInterface;

// Calling a JavaScript function from AS3 (with optional parameters)
if (ExternalInterface.available) ExternalInterface.call("javascriptFunction", param1, param2);

// Implementing a JavaScript callback in AS3 (flashFunction is called when JavaScript calls javascriptFunction)
if (ExternalInterface.available) ExternalInterface.addCallback("javascriptFunction", flashFunction);