 
     private function onSaveComplete(event:Event):void {
       var loader:URLLoader = URLLoader(event.target);
-      ExternalInterface.call(this.EVENT_HANDLER, RecorderJSInterface.SAVED, this.recorder.currentSoundName, loader.data);
+      ExternalInterface.call(EVENT_HANDLER, RecorderJSInterface.SAVED, recorder.currentSoundName, loader.data);
     }
 
     private function onIOError(event:Event):void {
-      ExternalInterface.call(this.EVENT_HANDLER, RecorderJSInterface.SAVE_FAILED, this.recorder.currentSoundName, IOErrorEvent(event).text);
+      ExternalInterface.call(EVENT_HANDLER, RecorderJSInterface.SAVE_FAILED, recorder.currentSoundName, IOErrorEvent(event).text);
     }
 
     private function onSecurityError(event:Event):void {
-      ExternalInterface.call(this.EVENT_HANDLER, RecorderJSInterface.SAVE_FAILED, this.recorder.currentSoundName, SecurityErrorEvent(event).text);
+      ExternalInterface.call(EVENT_HANDLER, RecorderJSInterface.SAVE_FAILED, recorder.currentSoundName, SecurityErrorEvent(event).text);
     }
 
     private function onProgress(event:Event):void {
-      ExternalInterface.call(this.EVENT_HANDLER, RecorderJSInterface.SAVE_PROGRESS, this.recorder.currentSoundName, ProgressEvent(event).bytesLoaded, ProgressEvent(event).bytesTotal);
+      ExternalInterface.call(EVENT_HANDLER, RecorderJSInterface.SAVE_PROGRESS, recorder.currentSoundName, ProgressEvent(event).bytesLoaded, ProgressEvent(event).bytesTotal);
     }
   }
 }


    private function announceMicrophoneInaccessibility():void {
      if (isMicrophoneConnected()) {
        ExternalInterface.call(this.EVENT_HANDLER, RecorderJSInterface.MICROPHONE_USER_REQUEST);
      } else {
        ExternalInterface.call(this.EVENT_HANDLER, RecorderJSInterface.NO_MICROPHONE_FOUND);
      }
    }

    public function requestMicrophoneAccess():void {
      this.recorder.mic.addEventListener(StatusEvent.STATUS, onMicrophoneStatus);
      this.recorder.mic.setLoopBack(true);
    }

    private function onMicrophoneStatus(event:StatusEvent):void {
      this.recorder.mic.setLoopBack(false);
      if(event.code == "Microphone.Unmuted") {
        this.configureMicrophone();
        ExternalInterface.call(this.EVENT_HANDLER, RecorderJSInterface.MICROPHONE_CONNECTED, this.recorder.mic);
      } else {
        ExternalInterface.call(this.EVENT_HANDLER, RecorderJSInterface.MICROPHONE_NOT_CONNECTED);
      } 
    }

    public function configureMicrophone(rate:int=22, gain:int=100, silenceLevel:Number=0, silenceTimeout:int=4000):void {
      this.recorder.mic.setRate(rate);
      this.recorder.mic.setGain(gain);
      this.recorder.mic.setSilenceLevel(silenceLevel, silenceTimeout);
    }

    public function setUseEchoSuppression(useEchoSuppression:Boolean):void {
      this.recorder.mic.setUseEchoSuppression(useEchoSuppression);
    }

    public function setLoopBack(state:Boolean):void {
      this.recorder.mic.setLoopBack(state);
    }

    public function record(name:String, filename:String=null):Boolean {
      if (this.isMicrophoneAccessible()) {
        if(this.recorder.recording) {
          this.recorder.stop();
          ExternalInterface.call(this.EVENT_HANDLER, RecorderJSInterface.RECORDING_STOPPED, this.recorder.currentSoundName, this.recorder.duration());
        } else {
          this.recorder.record(name, filename);
          ExternalInterface.call(this.EVENT_HANDLER, RecorderJSInterface.RECORDING, this.recorder.currentSoundName);
        }
        return this.recorder.recording;
      } else {
        announceMicrophoneInaccessibility();
        return false;

    }

    private function playbackStarted(event:Event):void {
      ExternalInterface.call(EVENT_HANDLER, MicrophoneRecorder.PLAYBACK_STARTED, recorder.currentSoundName, recorder.latency);
    }

    private function playComplete(event:Event):void {
      ExternalInterface.call(EVENT_HANDLER, RecorderJSInterface.STOPPED, recorder.currentSoundName);
    }

    private function microphoneActivity(event:Event):void {
      ExternalInterface.call(EVENT_HANDLER, RecorderJSInterface.MICROPHONE_ACTIVITY, recorder.mic.getActivityLevel());
    }

    private function microphoneLevel(event:MicrophoneLevelEvent):void {
      ExternalInterface.call(EVENT_HANDLER, RecorderJSInterface.MICROPHONE_LEVEL, event.levelValue);
    }

    private function microphoneSamples(event:MicrophoneSamplesEvent):void {
      ExternalInterface.call(EVENT_HANDLER, RecorderJSInterface.MICROPHONE_SAMPLES, event.samples);
    }

    public function init(url:String=null, fieldName:String=null, formData:Array=null):void {
      uploadUrl = url;
      uploadFieldName = fieldName;
      update(formData);
    }

    public function update(formData:Array=null):void {
      uploadFormData = [];
      if(formData) {
        for(var i:int=0; i<formData.length; i++) {
          var data:Object = formData[i];
          uploadFormData.push(MultiPartFormUtil.nameValuePair(data.name, data.value));
        }
      }
    }

    public function isMicrophoneAccessible():Boolean {
      return isMicrophoneConnected() && !recorder.mic.isMuted();
    }

    private function isMicrophoneConnected():Boolean {
