Asynchronous Javascript calls from AS3?

Hello,

I’m currently using ExternalInterface.call() to call javascript in a webpage in which the swf sits, and that’s working fine until I find that the javascript function I’m calling sometimes takes a while. This causes the swf to “lock up” as it waits for ExternalInterface.call() to return.

Is there a way to call a JS function, then listen for, say, an Event.COMPLETE event? Or something similar?

I’d like to be able to call the function, do a few other animations, then when those finish, the Javascript call is done and I have the data I need from it (or if it isn’t, I can show a message saying “Loading…” or something).

Thanks in advance!