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

mymic

import flash.net.NetStream;
import flash.events.NetStatusEvent;
import flash.events.SecurityErrorEvent;
import flash.media.Video;
Get Adobe Flash player
by BarudEtni 17 Oct 2009
/**
 * Copyright BarudEtni ( http://wonderfl.net/user/BarudEtni )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/167Y
 */

package {
      import flash.net.NetConnection;  
    import flash.net.NetStream;  
   // import flash.net.NetStream;
    import flash.events.Event;
    import flash.media.*;

    import flash.display.Sprite;
   // import flash.events.NetStatusEvent;
   // import flash.events.SecurityErrorEvent;
    // import flash.media.Video;
 
    public class MicTest extends Sprite {
        public function MicTest() {
           var nc:NetConnection;
           var mic:Microphone;
           var ns:NetStream;
           nc = new NetConnection();

          nc.onStatus = function(info){
               trace(info.code);
               if(info.code.indexOf("Success") != -1) {
                   getMic();
               }
           }
           
           function getMic(){
               mic = Microphone.get();
               ns = new NetStream(nc);
               ns.attachAudio(mic);
               ns.publish("mymic", "live");
           }           
           
                      nc.connect("rtmp:/libr8d.srfms.com/applications/serversidenetstreams/test1");
           
        }
    }
}