In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

Flash Player 10.1 test

Get Adobe Flash player
by mash 20 Nov 2009
/**
 * Copyright mash ( http://wonderfl.net/user/mash )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/kyHk
 */

package {
    import flash.display.Sprite;
    import flash.events.SampleDataEvent;
    import flash.media.Microphone;
    import flash.text.TextField;
    public class FlashTest extends Sprite {
        private var tf :TextField;
        private var counter :int = 0;
        public function FlashTest() {
            addTF();

            var mic:Microphone = Microphone.getMicrophone();
            if ( mic ) {
                tf.appendText( mic.name + " found, data from mic will follow if FP10.1 enabled\n" );
                mic.setLoopBack(true);
                mic.rate = 44;
                mic.addEventListener(SampleDataEvent.SAMPLE_DATA, micSampleDataHandler);
            }
            else {
                tf.appendText( "no mic found.." );
            }
        }
        private function micSampleDataHandler( e :SampleDataEvent ) :void {
            tf.appendText(
                "["+ counter++ +"]"
                 + e.data.length
                 + "\n" );
        }
        private function addTF() :void {
            tf = new TextField;
            tf.width = 465;
            tf.height = 465;
            tf.text = "start..\n";
            addChild( tf );
        }
    }
}