Skip to main content
April 25, 2010
Question

as2 / shadowbox / js - i'm about to cry

  • April 25, 2010
  • 1 reply
  • 648 views

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!!!!!

This topic has been closed for replies.

1 reply

April 25, 2010

anyone has an idea?

i basically just want to know if it's possible to call different var from javascript file with as2....

April 27, 2010

anyone?...:(