문제

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?

도움이 되었습니까?

해결책 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).

다른 팁

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).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top