Reputation: 259
I'm trying to get javascript to talk to flash, but I haven't been able to get it to work. I've gotten flash to talk to javascript, but not the other way around. It seems as thought flash isn't listening to the javascript, or I'm doing something wrong. Any suggestions?
Part of the AS3 to initially call the js:
ExternalInterface.call("showGal", slastSelectedNumber);
The js i'm trying to use is:
function showGal(dPicture) {
document.getElementById('fullsizegallery').style.display = 'block';
document.getElementById("flashGalleryContent").someFunctionName(dPicture);
}
Part of the AS3 of other flash file I'm trying to talk to:
var connection = ExternalInterface.addCallback("someFunctionName", changePicNumber);
function changePicNumber(newNumber:Number):void {
picNumber = newNumber;
if (jsonLoaded == true) {
loadImageBig(picNumber);
}
}
Upvotes: 2
Views: 425
Reputation: 191
Make sure you have something like: <param name="allowScriptAccess" value="always" />
in the Flash html embedding.
Upvotes: 1