First off I don’t condone this type of behavior but it is very entertaining.
I wanted to write about the Microphone object in ActionScript this afternoon, but I couldn’t think of a good topic until I remembered the Microphone.activityLevel property. This property will return an integer between –1 and 100. 0 to 100 indicated a level of volume entering the microphone attached to the computer and –1 indicates no microphone is attached or the user has not ranted Flash permission to access their microphone. This leads to an interesting prank.
Why not gain access to a friend’s desktop and add you simple Flash file to their active desktop. The file will begin to spawn ‘Ha, Ha’ browser windows as the friend yells at their computer. The code I am giving you will cause more windows to spawn as the yells increase. This doesn’t work with the web though because Flash requires a user to give permission to the Flash file to gain access to their microphone.
The code and how it works:
var theMicrophone:Microphone = Microphone.get();
//create an instance of the microphone object
// and attach the microphone sound feed
//you will be attaching nothing if there is no feed,
// plus when the project is opened
//the user will need to give permission to access
//the microphone
theMicrophone.onActivity = function(active:Boolean) {
//when the microphone detects sound start the following function
if (active) {
//as the microphone hears louder sounds new browsers are spawned
if (theMicrophone.activityLevel>25) {
getURL("pranked.html", "_blank");
}
if (theMicrophone.activityLevel>50) {
getURL("pranked.html", "_blank");
}
if (theMicrophone.activityLevel>75) {
getURL("pranked.html", "_blank");
}
}
};
This can also be interesting for creating a customer support tool that detects the loudness of either the representative's voice or the customers, but we wouldn't want to do that would we.






1. Haha, reminds me of the time we played a prank on some boys that were on work experience. They kept running MSN, so on their lunchbreak I replaced messenger.exe with a flash projector that ran fullscreen and played a siren sound at full volume. Sneaky kids didn't like that when they clicked the shortcut!
Posted at 4:24PM on Jul 18th 2005 by Richard