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!
精彩评论