 			Security.showSettings("2");
 		}
 		
+		private function addEventListeners():void {
+			addEventListener(Event.ENTER_FRAME, onEnterFrame);
+			mic.addEventListener(StatusEvent.STATUS, onMicStatus, false, 0, true);
+			micRecorder.addEventListener(RecordingEvent.RECORDING, onRecording);
+			micRecorder.addEventListener(Event.COMPLETE, onComplete);			
+		}
+		
 		// Methods
 		public function isMuted():Boolean {
 			return muted;
 		}
 		
-		public function getActivityLevel():Number {
+		public function getActivityLevel():int {
 			return mic.activityLevel;
+		}
+		
+		public function getTime():int {
+			return this.time;
+		}
+		
+		public function getDuration():int {
+			return this.duration;
 		}
 		
 		public function getDataURL():String {

    import flash.media.Microphone;
	
	import Base64;
	
	public class Recorder extends Sprite {
		
		private var muted:Boolean = true;
		private var recording:Boolean = false;
		private var mic:Microphone;
		private var wavEncoder:WaveEncoder = new WaveEncoder();
		private var micRecorder:MicRecorder = new MicRecorder(wavEncoder);

		}
		
		// Event Handlers
		private function onEnterFrame(e:Event):void {
			var data:Object = {muted: this.muted, recording: this.recording, volume: mic.activityLevel};
			if (this.time) data.time = this.time;
			dispatchEvent(new RecorderEvent(RecorderEvent.STATUS, data, true));
		}
		
		private function onRecording(e:RecordingEvent):void {
			var data:Object = {time: e.time, volume: mic.activityLevel};
			dispatchEvent(new RecorderEvent(RecorderEvent.RECORDING, data, true));
		}
		
		private function onComplete(e:Event):void {
			var data:Object = {};
			dispatchEvent(new RecorderEvent(RecorderEvent.COMPLETE, data, true));
		}
		
		private function onMicStatus(e:StatusEvent):void {
			if (e.code == "Microphone.Unmuted"){
				muted = false;
				mic.removeEventListener(StatusEvent.STATUS, onMicStatus);
				dispatchEvent(new RecorderEvent(RecorderEvent.ENABLED, true));
			} else if (e.code == "Microphone.Muted") {
				mic.removeEventListener(StatusEvent.STATUS, onMicStatus);
				dispatchEvent(new RecorderEvent(RecorderEvent.DISABLED, true));
			}
		}
		
