Launching Shadowbox from Flash9 (AS3)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Launching Shadowbox from Flash9 (AS3)

tinylittlemint
I'm having a lot of trouble getting this to work.

I've found some examples, but they're written in AS2. I'm trying to rewrite to AS3. Can anyone help?


Here's the original:
import flash.external.*;

function build_lightbox():Void{ ExternalInterface.call("myflashShadowboxInjector.reset");
ExternalInterface.call("myflashShadowboxInjector.appendElement", "http://www.google.fr/", "legende", "0", "shadowbox[maGalerie]");
ExternalInterface.call("myflashShadowboxInjector.updateImageList");
}

esp.onPress = function() {
build_lightbox();
ExternalInterface.call("myflashShadowboxInjector.start","http://www.google.fr/","shadowbox[maGalerie]","0");
       
}


--------------


and here's what I have so far:

---------------
import flash.external.*;

//Button declared here
var testme_btn:SimpleButton = new button;
testme_btn.x = 0;
testme_btn.y = 0;
addChild( testme_btn);

//add ears to the button
testme.addEventListener(MouseEvent.CLICK, gohandleBuild);

//function of the button
function gohandleBuild(myEvent:MouseEvent):void {
Light_box();
ExternalInterface.call("myflashShadowboxInjector.start","http://www.google.com/","shadowbox[maGalerie]","0");
}

//lightbox
function Light_box(myEvent:MouseEvent):Void{
ExternalInterface.call("myflashShadowboxInjector.reset");
ExternalInterface.call("myflashShadowboxInjector.appendElement", "http://www.google.com/", "first page", "0", "shadowbox[maGalerie]");
ExternalInterface.call("myflashShadowboxInjector.updateImageList");
}

-------

When I run this, I get this:

1046: Type was not found or was not a compile-time constant: Void.