Domanda

I'm using ExternalInterface in my AS3 project to do some stuff via Javascript, but now I need to use it to call some function belong to an object.

Something like this (AS3):

ExternalInterface.call("VIEWER.loadComplete");

JS code:

var VIEWER = {
    loadComplete: function(){
        $('#'+this.maindiv).children('.mask').hide();
        $('#'+this.viewer).css({
            width:      '640px', 
            height:     '480px',
            overflow:   ''
        });
    }
}

This isn't working in Chrome (only works in Firefox, and I don't know why either). Can someone clarify me in this way?

È stato utile?

Soluzione 2

I solved my own problem adding the following to my SWF object embed in HTML:

<param name="AllowScriptAccess" value="always">

Now my SWF is able to call ExternalInterface (even in Chrome).

Altri suggerimenti

There are problems with the Chrome version of the player, the rules you set in Flash Player global settings are not used / loaded by this player. So you always get sandbox security errors and external interfaces dont work.

You need to go on the chrome plugin page chrome://plugins/ and desactivate the PPAPI (Pepper API, Chrome version) version of the flash Player and enable only the NPAPI version (classical).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top