Call JavaScript functions from Flash AS3

For one of my project clients want to use Lightbox in there website which is fully build of Flash AS3. I was wondering how to do that?
It will take time to make a gallery in Flash like Light Box. I was looking online if is there any way to call JavaScript functions from Flash.
Following is the simplest way to call JavaScript from Flash AS3.

The code which is required to call the function in AS3 is

import flash.external.ExternalInterface;
ExternalInterface.call("myFunction()");

Here myFunction() is the JavaScript function which is already there in my HTML page.
Very simple to call JS fuctions. By this I made my life easier by giving the almost same
feelings to my client of Flash and JQuery animations. Which might take more effort if
I try to make the same animation in Flash.

Download sample Example

test.zip

Leave a Reply

Your email address will not be published. Required fields are marked *