js + shadowbox + as2 (please help, i'm about to cry.)

classic Classic list List threaded Threaded
5 messages Options
Jo
Reply | Threaded
Open this post in threaded view
|

js + shadowbox + as2 (please help, i'm about to cry.)

Jo
Ok so here is the situation:

i have a swf. in that swf, i have 2 buttons (button_mc and button3_mc).

i'm trying to call different images with shadowbox (image gallery).

For now, one image works FINE:

flash:
//code for buttons

import flash.external.*;

button_mc.onPress = function (){
    ExternalInterface.call("MyGallery");
}

 

so this calls the first img in my js, which is:

 

function MyGallery(){
    var img = {
        player:     'img',
        content:    'images/test.jpg',
        height:     340,
        width:      405,
        title:      'Dramatic Look'
    };
               
        var img1 = {
        player:     'img',
        content:    'images/test2.jpg'
    };
     
        var img2 = {
        player:     'img',
        content:    'shadowbox-2.0/gallery/aston_martin/vantage.jpg'
    };

 

    Shadowbox.open([img, img1, img2], {
        continuous: true
    });

 

};

 

PROBLEM IS:

i want to be able to call the SECOND image when i click on the second button...
so i'm thinking... can you call a var in the js from flash?

i've tried
ExternalInterface.call("MyGallery:img1");
ExternalInterface.call("MyGallery",'img1');
ExternalInterface.call("MyGallery", img1);

and maybe 800 other things that dont even make sense... i'm desperate..

anyone would be able to help?

thx!!!!!
jo
Reply | Threaded
Open this post in threaded view
|

Re: js + shadowbox + as2 (please help, i'm about to cry.)

jo
anyone?...
jo
Reply | Threaded
Open this post in threaded view
|

Re: js + shadowbox + as2 (please help, i'm about to cry.)

jo
In reply to this post by Jo
i cant believe that no one had this problem....
Reply | Threaded
Open this post in threaded view
|

Re: js + shadowbox + as2 (please help, i'm about to cry.)

DgAPc
In reply to this post by Jo
Doing that way its not possible to call another image.  It only calls image 1.  Here is another way to call a gallery and you can also select what image you want in flash.

<script type="text/javascript"> function MyGallery(image) { var a = document.getElementById("img"+image+""); var f = new Array() f[1] = "images/test.jpg"; f[2] = "images/test2.jpg"; f[3] = "shadowbox-2.0/gallery/aston_martin/vantage.jpg"; var url = f[image]; a.className = 'url'; Shadowbox.open(a); }; </script><-a id="img1" href="images/test.jpg" rel="shadowbox[imgThumbs];options={counterType:'skip',continuous:true,animSequence:'sync'}"><-/a->

<-a id="img2" href="images/test2.jpg" rel="shadowbox[imgThumbs];options={counterType:'skip',continuous:true,animSequence:'sync'}"><-/a->

<-a id="img3" href="shadowbox-2.0/gallery/aston_martin/vantage.jpg" rel="shadowbox[imgThumbs];options={counterType:'skip',continuous:true,animSequence:'sync'}"><-/a->

flash
---------
on (press) {
getURL("javascript:MyGallery(1)");
}

for image 2

on (press) {
getURL("javascript:MyGallery(2)");
}

for image 3

on (press) {
getURL("javascript:MyGallery(3)");
}
Reply | Threaded
Open this post in threaded view
|

Re: js + shadowbox + as2 (please help, i'm about to cry.)

DgAPc
get rid of the - in the parts with the <-a and <-/a->.