4 Replies Latest reply on Aug 28, 2009 1:40 PM by liquid8x

    problems using a microphone example




      I'm interested to work with microphone input in my Flex-project but I'm having troubles just to getting started with it because I can't even make a basic example to work!


      Here is the example:




      And here is what I've done:


      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">



      import flash.media.Microphone;


      var mic:Microphone = Microphone.getMicrophone();
      mic.addEventListener(StatusEvent.STATUS, this.onMicStatus);


      function onMicStatus(event:StatusEvent):void
          if (event.code == "Microphone.Unmuted")
              trace("Microphone access was allowed.");
          else if (event.code == "Microphone.Muted")
               trace("Microphone access was denied.");




      This is the error that I'm getting:

      "The this keyword can not be used in static methods. It can only be used in instance methods, function closures, and global code.  "



      I would appreciate it a lot if someone could show me how to get going with this. Thanks!