In Actionscript 3.0, to call external JavaScript function, you need to use function ExternalInterface.call.
To call external JavaScript function in Slide3D Component, please follow below steps:
1. Add import line:
import flash.external.*;
2. Specify event handler function for parameter eventHandlerOnPress.
demoSlide.eventHandlerOnPress = "onPhotoClick";
3. Define event handler function:
function onPhotoClick(index:int):void
{
// call JavaScript only when image is on front
if (index == demoSlide.slideCurrent)
{
if (ExternalInterface.available)
ExternalInterface.call("JSFuncName", JSParameter);
}
}
You can use property slideCurrent of Slide3D component to get the current slide which is on front.
For more details about function ExternalInterface.call, please view the Help document of Adobe Flash CS3/CS4.
The downloaded package includes a demo project: demo_lightbox2.


