# Stupid JS / Flash issue

**URL:** <https://forum.kirupa.com/t/stupid-js-flash-issue/257628>\
**Category:** Uncategorized\
**Created:** [April 15, 2008, 6:57pm UTC](https://forum.kirupa.com/t/stupid-js-flash-issue/257628 "2008-04-15T18:57:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![JChristian](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@JChristian](https://forum.kirupa.com/u/JChristian)\
**Post date:** [April 15, 2008, 6:57pm UTC](https://forum.kirupa.com/t/stupid-js-flash-issue/257628/1 "2008-04-15T18:57:11Z")

</div>

Hello,

I’m trying to use [ShadowBox](http://mjijackson.com/shadowbox/index.html) with a flash image gallery i made, I have this in my flash file:

```auto
onRelease = function(){ getURL("javascript:openSBox('" + link + "')");} 

```

and this code in my HTML:

```auto

<script type="text/javascript" src="src/js/shadowbox.js"></script>
<script type="text/javascript">
window.onload = function(){
    Shadowbox.init();
};
function openSBox(page) {
       Shadowbox.open(page);
};
</script>

```

if I replace Shadowbox.open(page) with alert(page) it works, but I can’t figure out why shadowbox doesn’t like it’s own code !?

!!UPDATE!!

Today I replaced my button in flash with :

```auto

    img_info.imglLink.onRelease = function() {
        if (ExternalInterface.available) {
            ExternalInterface.call("Shadowbox.open({type:'img',content:'"+infostruc[current-1].imglLink+"'});");
        } else {
            getURL("javascript:Shadowbox.open({type:'img',content:'"+infostruc[current-1].imglLink+"'});", "_self");
        }
    };

```

kept the same javascript … and it STILL doesn’t work, but I did start getting an error from the javascript : ! match has no properties anybody familiar with shadowbox ??

---

<div class="post-metadata">

**Author:** ![insomaniaco](https://avatars.discourse-cdn.com/v4/letter/i/977dab/32.png) [@insomaniaco](https://forum.kirupa.com/u/insomaniaco)\
**Post date:** [May 12, 2008, 7:10am UTC](https://forum.kirupa.com/t/stupid-js-flash-issue/257628/2 "2008-05-12T07:10:28Z")

</div>

I’m trying to implement some shadowbox code to. Having problems also. Still i have accomplished to make it work with single images, I have not succeded on creating a gallery.,

my html code is:

```auto
<link rel="stylesheet" type="text/css" href="css/shadowbox.css">
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/shadowbox-prototype.js"></script>
<script type="text/javascript" src="js/shadowbox.js"></script>
<script type="text/javascript">

var name1, title1;
function test1(name1, title1){

    Shadowbox.init();

    Shadowbox.open({
    title: title1,    
    type: 'img', 
    content: '/'+ name1
    });
               };

```

Flash AS Code:

```auto

pictures_btn.onPress = function()
{
   getURL("javascript:test1(\'file.jpg\', \'File Name\')", "");
};

```

---

<div class="post-metadata">

**Author:** ![actionAction](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/actionaction/32/3987_2.png) [@actionAction](https://forum.kirupa.com/u/actionAction)\
**Post date:** [May 12, 2008, 4:01pm UTC](https://forum.kirupa.com/t/stupid-js-flash-issue/257628/3 "2008-05-12T16:01:57Z")

</div>

I haven’t done this with ShadowBox, but I have with Lightbox and it shouldn’t be too different. Two things first chaps, in case you don’t know, you have to make sure that the files are uploaded to your server, or else what your trying to accomplish will not work. I have attached a working example (with Lightbox) for you to toy around with, let me know if you have questions.

\_aA

---

<div class="post-metadata">

**Author:** ![insomaniaco](https://avatars.discourse-cdn.com/v4/letter/i/977dab/32.png) [@insomaniaco](https://forum.kirupa.com/u/insomaniaco)\
**Post date:** [May 12, 2008, 5:42pm UTC](https://forum.kirupa.com/t/stupid-js-flash-issue/257628/4 "2008-05-12T17:42:28Z")

</div>

thanks action^2

---

<div class="post-metadata">

**Author:** ![actionAction](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/actionaction/32/3987_2.png) [@actionAction](https://forum.kirupa.com/u/actionAction)\
**Post date:** [May 12, 2008, 5:58pm UTC](https://forum.kirupa.com/t/stupid-js-flash-issue/257628/5 "2008-05-12T17:58:51Z")

</div>

:thumb2:

No problem!

---

<div class="post-metadata">

**Author:** ![actionAction](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/actionaction/32/3987_2.png) [@actionAction](https://forum.kirupa.com/u/actionAction)\
**Post date:** [May 12, 2008, 6:07pm UTC](https://forum.kirupa.com/t/stupid-js-flash-issue/257628/6 "2008-05-12T18:07:32Z")

</div>

@JChristian: I believe that your specific issue is that you are not calling your JS function which calls the ShadowBox function when you use ExternalInterface. If you are going to use ExternalInterface, you should call the function like this:

```auto

//ExternalInterface.call(Function Name [, parameter1, parameter2, parameterN])
ExternalInterface.call("openSBox",link);

```

ExternalInterface has a hard time with JS functions located in different files, calling your inline function that calls your external js function is a much more reliable way of accomplishing this.

---

<div class="post-metadata">

**Author:** ![insomaniaco](https://avatars.discourse-cdn.com/v4/letter/i/977dab/32.png) [@insomaniaco](https://forum.kirupa.com/u/insomaniaco)\
**Post date:** [May 13, 2008, 7:28am UTC](https://forum.kirupa.com/t/stupid-js-flash-issue/257628/7 "2008-05-13T07:28:14Z")

</div>

[quote=actionAction;2325097]I haven’t done this with ShadowBox, but I have with Lightbox and it shouldn’t be too different. Two things first chaps, in case you don’t know, you have to make sure that the files are uploaded to your server, or else what your trying to accomplish will not work. I have attached a working example (with Lightbox) for you to toy around with, let me know if you have questions.

\_aA[/quote]

Looking more in to flash and lightbox comunication I came up with this site on google.

[http://www.bram.us/projects/flashlightboxinjector/](http://www.bram.us/projects/flashlightboxinjector/)

Is a JS that works with the latest LBox package

---

<div class="post-metadata">

**Author:** ![senan](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@senan](https://forum.kirupa.com/u/senan)\
**Post date:** [May 20, 2008, 5:18pm UTC](https://forum.kirupa.com/t/stupid-js-flash-issue/257628/8 "2008-05-20T17:18:59Z")

</div>

Hi – I’m trying to implement Shadowbox on my Flash site as well. Just starting to give it a whirl anyway. I’ve got a number of logos of company’s that we’ve done work for and would like to, upon click of each logo, open the respective image, .swf, url, etc. in Shadowbox. Right now, I’ve got a centered pop-up that I believe I got from one of the kirupa tutorials actually 🙂 but with pop-up blockers being what they are, it’s not so conducive.

Based on what I see being tried in this thread I’m wondering if anyone has it working properly? I took a look at [Bram.us](http://Bram.us) site and that’s primarily for use with lightbox which doesn’t support html or .swf – just images. And the pictureflow that does support Shadowbox I’m having trouble figuring out how to place the application exactly where I want it IN my flash app. So any thoughts on any/all of the above is hugely appreciated! Thanks in advance!

---

<div class="post-metadata">

**Author:** ![cjawcrusher512](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@cjawcrusher512](https://forum.kirupa.com/u/cjawcrusher512)\
**Post date:** [May 26, 2008, 3:13am UTC](https://forum.kirupa.com/t/stupid-js-flash-issue/257628/9 "2008-05-26T03:13:46Z")

</div>

[color=#282827]I agree with you !I support you .[/color]

---

<div class="post-metadata">

**Author:** ![JChristian](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@JChristian](https://forum.kirupa.com/u/JChristian)\
**Post date:** [May 27, 2008, 2:10pm UTC](https://forum.kirupa.com/t/stupid-js-flash-issue/257628/10 "2008-05-27T14:10:04Z")

</div>

I found the solution: Lightbox ++

[http://www.codefidelity.com/blog/?page\_id=7](http://www.codefidelity.com/blog/?page_id=7)

it doesn’t do HTML, I’m working on hacking it into this code.
