# Calling shaddowbox from AS2

**URL:** <https://forum.kirupa.com/t/calling-shaddowbox-from-as2/260693>\
**Category:** flash\
**Created:** [May 19, 2008, 12:42am UTC](https://forum.kirupa.com/t/calling-shaddowbox-from-as2/260693 "2008-05-19T00:42:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blakerblaker](https://avatars.discourse-cdn.com/v4/letter/b/3bc359/32.png) [@blakerblaker](https://forum.kirupa.com/u/blakerblaker)\
**Post date:** [May 19, 2008, 12:42am UTC](https://forum.kirupa.com/t/calling-shaddowbox-from-as2/260693/1 "2008-05-19T00:42:18Z")

</div>

I’m trying to call the [Shaddowbox Image Viewer](http://mjijackson.com/shadowbox/) from a flash button without any success.

The normal instance for calling it would be:

```auto
<a rel="shadowbox" href="imageURL">Image Name</a>

```

I’ve tried to initialize w/ javascript using

```auto
<script type="text/javascript">
function SWFDelegate(url,width,height,caption) {
   var objLink = document.createElement('a');
   objLink.setAttribute('href',url);
   objLink.setAttribute('rel','shadowbox');
}
</script>

```

and this AS2 in my flash file:

```auto
on (release) { getURL("javascript:SWFDelegate('images/TroddenWeed.jpg')");}

```

but nothing seems to work.

Any help would be much appreciated.
