开发者

ExternalInterface: cant't access some AS objects (movieclips) from a callback

开发者 https://www.devze.com 2023-01-28 03:38 出处:网络
basically, I have some functions in my as file. Some of them play with a mc instance. The inst开发者_StackOverflow中文版ance is not available when calling the function that uses it as callback. Is the

basically, I have some functions in my as file. Some of them play with a mc instance. The inst开发者_StackOverflow中文版ance is not available when calling the function that uses it as callback. Is there a way to solve?

Example.

AS

function B(){
    ExternalInterface.call('console.log','ok')//OK!!!
}

//italy is a MovieClip on the Main timeline
function A(){
    B();
 ExternalInterface.call('console.log',italy)//Error!
}

ExternalInterface.addCallback('test',A);

JS

$('flash').test();//flash is my html swf object

The error I get trying to reference italy from A (only) whem called from javascript:

uncaught exception: Error in Actionscript.


Basically, the italy movieclip is available through the AS functions. But it isn't available if I call an AS function from javascript. As you can see though, I see B from A. It's only Italy that I can't see. why?


Hey, no, it's all ok, it works. It was a bad error inside one of my methods.

Sorry. Maybe moderators could delete this question. Bye!

0

精彩评论

暂无评论...
验证码 换一张
取 消