Calling Javascript functions from Flash
2008 June 21
Calling Javascript functions from Flash is very easy. We use a class called ExternalInterface. Here is ActionScript code:
import flash.external.*;
import flash.events.Event;
button1.addEventListener(MouseEvent.CLICK, buttonHandle);
function buttonHandle(event:MouseEvent)
{
ExternalInterface.call("showMessage");
}
Here flash.external is a package where the class ExternalInterface is found.
The code is very simple. Event listener to button is added. And call is a method of ExternalInterface class, the parameter passed to call() is a name of the Javascript function.
The Javascript function is an alert message:
function showMessage()
{
alert("Hi from flash");
}



i want to use
Image 2
a html link to a class, (lightbox image effect) but on flash can you help me??