# Problems with Lightbox with AS3 in IE

**URL:** <https://forum.kirupa.com/t/problems-with-lightbox-with-as3-in-ie/270073>\
**Category:** flash\
**Created:** [September 4, 2008, 9:58pm UTC](https://forum.kirupa.com/t/problems-with-lightbox-with-as3-in-ie/270073 "2008-09-04T21:58:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ricky55](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@Ricky55](https://forum.kirupa.com/u/Ricky55)\
**Post date:** [September 4, 2008, 9:58pm UTC](https://forum.kirupa.com/t/problems-with-lightbox-with-as3-in-ie/270073/1 "2008-09-04T21:58:05Z")

</div>

Hi

I have been using Lightbox with AS2 no problem but my latest project is in AS3, I came on the forum before and asked about this when I was testing the file and I was told to use the externalinterface call, I eventually got this code:

```auto

test_mc.addEventListener(MouseEvent.CLICK,callJS);

function callJS(event:MouseEvent):void
{
    ExternalInterface.call("flashLightbox", "images/jenson.jpg", "Jenson in Action" );
}

test_mc.buttonMode = true;

```

At the time I tested in Safari and it worked so I moved on to something else.

Now the site is complete and I have tested the page in Internet Explorer and the image fails to load I just get an error. With the old AS2 code it did work in IE.

I’ve been looking around and I’ve found some more code but I can’t get this to work in any browser, can one of you guys tell me where I’m going wrong.

The alternative code  
This in the HTML file

```auto

<script language="JavaScript">
function SWFDelegate(url,width,height,caption) {
   var objLink = document.createElement('a');
   objLink.setAttribute('href',url);
   objLink.setAttribute('rel','lightbox');
   objLink.setAttribute('title',caption);
   if(typeof width != 'undefined') {
      objLink.setAttribute('width',width);
   }
   if(typeof height != 'undefined') {
      objLink.setAttribute('height',height);
   }
   Lightbox.prototype.start(objLink);
}
</script>
[\code]

And the AS

```

test\_mc.addEventListener(MouseEvent.CLICK,callJS);

function callJS(event:MouseEvent):void  
{  
ExternalInterface.call(“SWFDelegate”,“images/jenson.jpg”,“600”,“398”,“Jenson in Action”);  
}

test\_mc.buttonMode = true;

```auto

I have the AllowScriptAccess set to always as well.

Any help will be much appreciated !
```
