Microphone Use within FLASH
3 posts
Page 1 of 1
Hi All
Here is a cool Tutorial on using your Microphone in Flash
1.Open up Flash and create a new file.
2. Set the width and height to 300 x 200
3. Draw a medium-sized circle using the circle tool from your toolbox
![Image]()
*Once you have drawn your circle, you will need to make the circle a movie clip.
4. Select your circle and press F8 or go to Modify | Convert to Symbol. From the dialog box that appears, select Movie clip and press OK.
5. We will need to now give our movie clip an instance name. Select your circle again, look in the bottom-left hand side of your screen where the Properties panel lives, and enter circle as the < Instance Name >.
6. Now, on the first frame of your movie, we can now add some ActionScript. Select the first frame in your timeline and press F9
Enter the following code:
![Image]()
*Is that COOL or What cooll;
Code Explanation
I will explain what the function of each line in the tutorial is:
m = Microphone.get();
This tells flash to start taking input from the microphone connected to the computer.
_root.attachAudio(m);
This line attaches the audio to the _root, so that every object can access it with the object 'm'.
m.setUseEchoSuppression(false);
This prevents that awful echo from happening, and it is also accessible in the flash movie properties and settings.
onEnterFrame = function () {
circle._xscale = circle._yscale = m.activityLevel+50;
};
This section of code scales our circle movie clip based on the activity (noise) level of our microphone. The activityLevel command returns a value between 0 and 100, depending on the microphone input. In order to get an activity level of 0, your microphone should be really REALLY good!
*SWF File Attachment Below and the Flash 8 Source File
Enjoy cooll;
Chris
Here is a cool Tutorial on using your Microphone in Flash
1.Open up Flash and create a new file.
2. Set the width and height to 300 x 200
3. Draw a medium-sized circle using the circle tool from your toolbox

*Once you have drawn your circle, you will need to make the circle a movie clip.
4. Select your circle and press F8 or go to Modify | Convert to Symbol. From the dialog box that appears, select Movie clip and press OK.
5. We will need to now give our movie clip an instance name. Select your circle again, look in the bottom-left hand side of your screen where the Properties panel lives, and enter circle as the < Instance Name >.
6. Now, on the first frame of your movie, we can now add some ActionScript. Select the first frame in your timeline and press F9
Enter the following code:
Code: Select all
Test your movie by previewing this page in your browser. Go to File | Publish Preview | HTML.m = Microphone.get();
attachAudio(m);
m.setUseEchoSuppression(false);
onEnterFrame = function () {
circle._xscale = circle._yscale = m.activityLevel+50;
};

*Is that COOL or What cooll;
Code Explanation
I will explain what the function of each line in the tutorial is:
m = Microphone.get();
This tells flash to start taking input from the microphone connected to the computer.
_root.attachAudio(m);
This line attaches the audio to the _root, so that every object can access it with the object 'm'.
m.setUseEchoSuppression(false);
This prevents that awful echo from happening, and it is also accessible in the flash movie properties and settings.
onEnterFrame = function () {
circle._xscale = circle._yscale = m.activityLevel+50;
};
This section of code scales our circle movie clip based on the activity (noise) level of our microphone. The activityLevel command returns a value between 0 and 100, depending on the microphone input. In order to get an activity level of 0, your microphone should be really REALLY good!
*SWF File Attachment Below and the Flash 8 Source File
Enjoy cooll;
Chris
You do not have the required permissions to view the files attached to this post.
thanks for the tut!
------------------------------------------------------------------------------
Proprogrammer, not just a Programmer.
Proprogrammer, not just a Programmer.
Check the date dude! This is the second time you did this today. First spamming, and now bumping.
3 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023