从 flash 到 OOP javascript 中的函数的外部接口调用
当 Flash 对象添加到 JavaScript 的 OOP 结构中时,我无法从 Flash 调用 JavaScript 函数。简而言之,代码:
In flash:
if (ExternalInterface.available) {
ExternalInterface.call("flashMessages", "ready");
}
Code in javascript:
function fbTeaserClass(){
function loadVideoObject(){
...
swfobject.embedSWF(sitebase+'/FocusVideo.swf', 'myContent'+uniqueid, '100%', '100%', '9.0.0', 'expressInstall.swf', flashvars, params, attributes, outputStatus);
}
this.flashMessages=function(message){
alert('called');
}
}
Flash 已加载,但未收到对 javascript 函数的调用。任何人有任何想法出了什么问题吗?
I can't call a javascript function from flash, when the flash object is added within an OOP structure in javascript. In short the code:
In flash:
if (ExternalInterface.available) {
ExternalInterface.call("flashMessages", "ready");
}
Code in javascript:
function fbTeaserClass(){
function loadVideoObject(){
...
swfobject.embedSWF(sitebase+'/FocusVideo.swf', 'myContent'+uniqueid, '100%', '100%', '9.0.0', 'expressInstall.swf', flashvars, params, attributes, outputStatus);
}
this.flashMessages=function(message){
alert('called');
}
}
Flash gets loaded, but the call to the javascript function isn't received. Anyone any ideas what's wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最有可能是范围问题,您的函数位于对象内部,尝试调用“fbTeaserClass.flashMessage”,您可能还需要在另一个级别初始化闪存。
Most likely a scope issue, your function is inside an object, try calling "fbTeaserClass.flashMessage", you may need to initialise the flash at another level also.