quarks
quarks

Reputation: 35276

Flash Javascript interface

Say I have this javascript function:

    function updateMainBuff(buff) {
                // do some stuff
    }

I have this function in my Flash project (full source here: bitly.com/SnyhGT ) :

protected function recordSampleDataHandler(event:SampleDataEvent):void
                    {       
                            while(event.data.bytesAvailable)
                            {       
                                    var sample:Number = event.data.readFloat();

                                    buffer.writeFloat(sample);
                                    if(buffer.length % 40000 == 0){
                                            triggerEvent('recordingProgress', recordingDuration(),  microphone.activityLevel);
                                    }       
                            }
                    }

What I need to do is to push every var sample float into the javascript function updateMainBuff

Upvotes: 0

Views: 137

Answers (1)

cloakedninjas
cloakedninjas

Reputation: 4176

This should do it

ExternalInterface.call("updateMainBuff", sample);

Upvotes: 2

Related Questions