Captivate-to-Flash Communication:
ExternalInterface Workaround: 2 SWFs on one page

It appears you either don't have Flash Player 7 (or higher) installed, or you have JavaScript disabled in your browser. Please make sure Flash Player is installed and JavaScript is enabled, then refresh your browser.

It appears you either don't have Flash Player 8 (or higher) installed, or you have JavaScript disabled in your browser. Please make sure Flash Player is installed and JavaScript is enabled, then refresh your browser.

This example demonstrates communication between a Captivate SWF (left) and Flash SWF (right) via Flash's ExternalInterface class. The quiz was created in Captivate using a combination of built-in quiz question templates and homemade 'quiz' slides (simple buttons and click boxes with captions). The 'scorekeeper' SWF was created in Flash and displays score information as well as end-of-quiz feedback based on the total score.

This example isn't meant to be a great example for quiz building (it's very flawed!), but is useful for demonstrating how a Captivate SWF can work with a Flash SWF embedded elsewhere on an HTML page.

How it works:
The basic chain of events looks like this: Captivate invokes a JavaScript function > JavaScript invokes a Flash EI callback > the Flash EI callback invokes an ActionScript function

This particular Captivate quiz is configured to call three JavaScript functions at appropriate times:

The corresponding JavaScript functions are located in the HTML's <head> section. These functions act as a proxy, triggering a corresponding ActionScript function in the Flash SWF via an ExternalInterface (EI) callback.

Important notes:

This example created by Philip Hutchison, October-November 2007. https://lab.pipwerks.com/captivate

This work is licensed under the Creative Commons Attribution 3.0 Unported License.
To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or send a letter to
Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.