I’m trying to use lightbox from AS3, but I can’t make it to work…
The code I have is:
_contenedor.but.addEventListener(MouseEvent.CLICK,callJS);
function callJS(event:MouseEvent):void {
ExternalInterface.call("PopFromFlash", "images/thumbs.jpg");
}
but it doesn’t work. The screen goes black and that’s it, it doesn’t show any picture. I already have added params.allowscriptaccess = “always”; in the swfobject…
And this is the js function that calls the lightbox, which it’s actually called because it popups the alert
<script type=“text/javascript”>
function PopFromFlash(url) {
var imgLink = document.createElement(‘a’);
imgLink.setAttribute(‘href’, url);
imgLink.setAttribute(‘rel’,‘lightbox’);
Lightbox.prototype.start(imgLink);
alert(“Test function”);
}
</script>
Any help will be really appreciated.