A JavaScript function called jsReceiveRawAudioDataFromFlash(rawData) is called almost every  100 ms, depending on how fast the microphone in Flash collects audio data.
function jsReceiveRawAudioDataFromFlash(rawData) {
    document.write("Beginning of this JS function");
    // Computation expensive work
    // I CANNOT put this work in Flash, must be in JavaScript
    // Send it to the network (server)
    document.write("Beginning of this JS function");
}
Every time the Flash microphone collects a fragment of audio data, it will call this JavaScript function.
This JS function receives the rawData, and does some very computation expensive work, and then sends out to the network (server).
I found that, the previous call has NOT be finished, another call is started, and then the un-executed part of the previous call is dropped off. EDIT - (I had a memory issue within this function, after I fixed it, it does not get dropped off)
So I need to schedule the call. How could I do it?
Thanks.
Peter
 
    