ExternalInterface call from flash to function in OOP 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");
}
开发者_JAVA百科
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?
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.
精彩评论