问题
First version:
ExternalInterface.call("$(document).trigger", "opened_file_chooser");
Second version:
ExternalInterface.call("$(document).trigger('opened_file_chooser')");
If I use the first version, it's much, much slower than the second. Also, the browser blocks, and after a few seconds Firefox shows me the dialog with "A script is not responding ... " and it offers me the possibility of stopping it. If I use the 2nd version, the call to Javascript is instantaneous. Is there a way I could make the first one work as well as the second? I think it's much cleaner ( from a code point of view ).
回答1:
Try setting a timeout which will let ExternalInterface "return" to Flash which should help with the blocking:
ExternalInterface.call("setTimeout","$(document).trigger('opened_file_chooser')","100");
来源:https://stackoverflow.com/questions/12062651/externalinterface-gives-me-an-option-of-stopping-the-script-when-using-multiple