# Lightbox using AS3

**URL:** https://forum.kirupa.com/t/lightbox-using-as3/298405
**Category:** flash
**Created:** [October 18, 2009, 11:55am UTC](https://forum.kirupa.com/t/lightbox-using-as3/298405 "2009-10-18T11:55:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sarah3585](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sarah3585](https://forum.kirupa.com/u/sarah3585)
#### Post date: [October 18, 2009, 11:55am UTC](https://forum.kirupa.com/t/lightbox-using-as3/298405/1 "2009-10-18T11:55:42Z")

</div>

I can’t seem to find any tutorials on this for AS3 on the web.  
I have images set up already in a flash gallery that I want to use lightbox to show larger and maybe even a few more images per thumbnail.

I have my javascript in my HTML set up:

```auto
<script type="text/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>

```

AS3 (not working)

```auto
test_mc.addEventListener(MouseEvent.CLICK,SWFDelegate);

function SWFDelegate(event:MouseEvent):void
{
ExternalInterface.call("SWFDelegate" "image/dfgaer.jpg","640","399","cheese" );
}

test_mc.buttonMode = true;

```

Any idea where I’m going wrong?
