George Reith
George Reith

Reputation: 13476

ExternalInterface not working

I am trying to use ExternalInterface to add a callback function like so:

import flash.external.*;
ExternalInterface.addCallback("makedoom", null, forceProgress);

I know my function forceProgress works (It has global scope) as I have used it with a simple onRelease and it works as expected, however when used via externalInterface nothing seems to happen.

I embedded my SWF (on an external server) with the allowScriptAccess paramater set to always.

When I type javascript:makedoom(); into the address bar in any browser, nothing seems to happen. I get no console errors .etc

Does anyone know what I am doing wrong?

Upvotes: 0

Views: 473

Answers (1)

Flassari
Flassari

Reputation: 1229

You have to invoke the makedoom function on the flash dom object, it is not registered in the global JS scope.

Use document.getElementById("theIDofYourFlashObject").makedoom() when you are sure the swf has loaded and registered the callback already.

Upvotes: 0

Related Questions