# Asynchronous Javascript calls from AS3?

**URL:** <https://forum.kirupa.com/t/asynchronous-javascript-calls-from-as3/313782>\
**Category:** flash\
**Created:** [September 9, 2010, 1:55pm UTC](https://forum.kirupa.com/t/asynchronous-javascript-calls-from-as3/313782 "2010-09-09T13:55:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![esaevian](https://avatars.discourse-cdn.com/v4/letter/e/74df32/32.png) [@esaevian](https://forum.kirupa.com/u/esaevian)\
**Post date:** [September 9, 2010, 1:55pm UTC](https://forum.kirupa.com/t/asynchronous-javascript-calls-from-as3/313782/1 "2010-09-09T13:55:25Z")

</div>

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!
