3.02.2011

Work on the Sound Detection by AS3.0 on Flash

After I have finished the hardware part, I started to do the software part. It is a sound detection using Adobe Flash CS4.

First of all, I did the main function sound detection on programming. I used the function Microphone() to do the sound detection. I roughly made a yellow ball to be a target of the detection response.

// declare the control on Microphone
var mic:Microphone = Microphone.getMicrophone();
Security.showSettings(SecurityPanel.MICROPHONE);
mic.setLoopBack(false);  


After I have got the control with microphone, I tried to resize a target by control the scale() of the object.
 // the size value of the yellow ball is increased by sound detected
if (actLevel > 0) {
   ball.scaleX *= 1.1;
   ball.scaleY *= 1.1;
   }