外部接口回调不听吗?不听、回调、接口

2023-09-08 14:19:31 作者:三岁就会撩妹

我试图让JavaScript来谈谈闪光灯,但我一直没能得到它的工作。我已经得到了周围闪交谈JavaScript的,而不是其他的方式。这似乎为思想闪光灯不听的JavaScript,或者说我做得不对。有什么建议?

在AS3的一部分,最初叫JS:

  ExternalInterface.call(showGal,slastSelectedNumber);
 

JS的我想要用的是:

 函数showGal(dPicture){
。的document.getElementById('fullsizegallery')的style.display =块;
的document.getElementById(flashGalleryContent)someFunctionName(dPicture)。
}
 

其他Flash文件我想谈的AS3的部分:

  VAR连接= ExternalInterface.addCallback(someFunctionName,changePicNumber);

功能changePicNumber(newNumber:编号):无效{
picNumber = newNumber;
如果(jsonLoaded ==真){
loadImageBig(picNumber);
}
}
 
第三方应用接口回调错误

解决方案

请确保您有类似:< PARAM NAME =allowScriptAccess的值=总是/> 在Flash嵌入HTML

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);
}
}

解决方案

Make sure you have something like: <param name="allowScriptAccess" value="always" /> in the Flash html embedding.

 
精彩推荐