This tutorial is the interaction of flash and microphone. Hopefully, you'll get better inspiration by learning this microphone interactive tutorial.
First look at this example, click Allow[Allow] and make a sound with the microphone, the effect is as follows:
OK, here we will step by step to achieve the above flash function:
1. Turn on flash and create a new 300*200 scene
2. Draw a medium circle in the scene with the drawing Circle tool in the toolbar
3. Turn this circle into a component and set it as a movie clip--Select the circle you just painted, click F8, or click [Modify][modify]-[to convert to symbol][convert to symbol], select [Movie clip][movie Clip] in the dialog box, click [OK] [ Ok
4. After completing the previous step, we click on the component in the scene and enter Circle in the [Instance Name] in the properties panel
5. Now we can write our ActionScript commands in the first frame of the timeline-click the first frame in the Timeline panel, click F9 or [Window][window]-[action] [Development Panels-action], Enter the following program into the action panel:
Code:
m = Microphone.get (); Attachaudio (m); M.setuseechosuppression (FALSE); Onenterframe = function () {Circle._xscale = Circle._yscale = m.activitylevel+50;};
6. By completing the above steps, you will be able to preview the--[file in your Web page]-[release preview]-[html]. Let's explain the meaning of each line of code for you:
Code:
m = Microphone.get ();
Let the Flash program connect to the signal entered by the microphone
Code:
This line of command connects audio to the _root so that each object can communicate with ' m '
Code:
M.setuseechosuppression (FALSE);
Prevents the echo from being affected by the code:
Onenterframe = function () {Circle._xscale = Circle._yscale = m.activitylevel+50; };
The function of this code is to use the sound to control the size of the graphics we set, and the Activitylevel is to return a value of 0-100 from the input of the sound.
OK, this tutorial is over, we can practice more, may have unexpected effect!
Don't translate well, please refer to me just as there are errors please PM me