2

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?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

7 Comments

You are right. A function called flashMessages(){..} is called (placed outside the object), only not in FireFox (other browsers give me the alert). Is that a common issue of FireFox?
If you change the code to do something other than an alert(), change something on the page for instance, does that work in FireFox?
FireFox does have a few issues with this, what do you have in your attributes variable? If you could add in all the run up to the SWFObject call that would be handy.
In my attributes I have: var attributes = { id: 'flash'+uniqueid, name: 'flash'+uniqueid }
Also have some Params: var params = { allowscriptaccess: 'always', wmode: 'transparent', allowFullScreen: 'true' };
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.