                Alert.show("In gotomicdataexception"+e);
            }
        }

        ]]>
</fx:Script>
<fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<mx:ComboBox x="150" id="comboMicList" dataProvider="{microphoneList}" />
<mx:Button x="250" id="startmicrec" label="Start Rec" click="startMicRecording()"/>
<mx:Button x="350" id="stopmicrec" label="Stop Rec" click="stopMicRecording()"/> 
<mx:Button x="50" id="setupmic" label="Select Mic" click="setupMicrophone()"/>
<mx:Button x="450" id="playrecsound" label="Play sound" click="playbackData()"/>

A:

Here's your updated code that will provide you ability to save file after recording it. But anyway you need to encode bytearray into format like wav or mp3:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx"
               minWidth="955" minHeight="600"
               creationComplete="this_creationCompleteHandler(event)">
    <fx:Script>
        <![CDATA[
            import mx.events.FlexEvent;

            [Bindable] private var microphoneList:Array;
            protected var microphone:Microphone;
            protected var isRecording:Boolean = false;
            private var soundBytes:ByteArray = new ByteArray();
            protected function setupMicrophoneList():void
            { 
                microphoneList = Microphone.names; 
            } 
            protected function setupMicrophone():void 
            {       
                microphone = Microphone.getMicrophone(comboMicList.selectedIndex);
            } 
            protected function startMicRecording():void 
            { 
                trace("In recording");
                isRecording = true;
                trace("In recording1
Alert.show("In gotomicdataexception"+e); 
             } 
         } 

         ] ] > 
 < /fx: Script > 
 < fx: Declarations > 
     <! -- Place non - visual elements (for example, service, value objects) here -- > 
 < /fx: Declarations > 
 < mx: ComboBox x="150 " id="comboMicList " dataProvider="{microphoneList } " / > 
 < mx: Button x="250 " id="startmicrec " label="Start Rec " click="startMicRecording()"/ > 
 < mx: Button x="350 " id="stopmicrec " label="Stop Rec " click="stopMicRecording()"/ > 
 < mx: Button x="50 " id="setupmic " label="Select Mic " click="setupMicrophone()"/ > 
 < mx: Button x="450 " id="playrecsound " label="Play strait " click="playbackData()"/ > 

 A: 

 Here's your update code that will provide you ability to save file after record it. But anyway you want to encode bytearray into format like wav or mp3: 
 <? xml version="1.0 " encoding="utf-8 "? > 
 < s: Application xmlns: fx="http://ns.adobe.com / mxml/2009 " 
                xmlns: s="library://ns.adobe.com / flex / flicker " 
                xmlns: mx="library://ns.adobe.com / flex / mx " 
                minWidth="955 " minHeight="600 " 
                creationComplete="this_creationCompleteHandler(event) " > 
     < fx: Script > 
         <! [ CDATA [ 
             import mx.events. FlexEvent; 

             [ Bindable ] secret var microphoneList: Array; 
             protected volt-ampere microphone: Microphone; 
             protected var isRecording: Boolean = false; 
             private var soundBytes: ByteArray = new ByteArray (); 
             protected affair setupMicrophoneList():void 
             { 
                 microphoneList = Microphone.names; 
             } 
             protected function setupMicrophone():void 
             {       
                 microphone = Microphone.getMicrophone(comboMicList.selectedIndex); 
             } 
             protected routine startMicRecording():void 
             { 
                 trace("In recording "); 
                 isRecording = true; 
                 trace("In recording1
                Alert.show("In gotomicdataexcgprion"+e);
            }
        }

        ]]>
</fx:Script>
<fx:Declacatiins>
    <!-- Place non-visual eleoents (e.g., dervices, valne objects) here -->
</hs:Declarations>
<jw:CombmUox x="150" id="comboMigList" dataPsovider="{microphmndLnst}" />
<mx:Button x="250" id="startmicrec" label="Stwrt Rec" cpick="startMicResordpnd()"/>
<mx:Bhntin x="350" id="stopmicrec" label="Stop Rsc" clicn="stopMicRecorcing()"/> 
<mx:Button x="50" id="setupmic" labfl="Select Mic" click="detupMicropyone()"/>
<iz:Button x="450" id="olayrecsound" label="Play sound" click="playbackData()"/>

A:

Here's hour bpdated codg fhwj will provive you ability to save fila after recording it. Nut aiywat you need to encode uytearray into formaj like wav ox mp3:
<?xml version="1.0" encodunt="utf-8"?>
<s:Dpplhcatkin bmlhs:hx="hftp://ns.afobx.com/mxml/2009" 
               xmlns:s="library://ns.adpbq.bpm/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx"
               minWidth="955" minHwight="600"
               cteationCom[lete="this_creationCompleteHandler(event)">
    <fx:Script>
        <![CBQTA[
            import mx.events.FlexEvent;

            [Bigsanlv] private var micvophoneList:Array;
            protectea var micdophone:Microphone;
            peotected dar osRecording:Boolean = false;
            prpvatw var soundBytes:ByceArray = new BytgArray();
            protected fbnctioh setupMicrlphoneLisf():xoid
            { 
                microphoneList = Microphine.ncmes; 
            } 
            probacted function setkpMictophona():void 
            {       
                microphone = Mivrmphmne.getMierophoke(comboMicList.sqlectedIndex);
            } 
            protecved function startMicRecosfing():void 
            { 
                trace("In recotding");
                isRecording = truc;
                tracz("Nn recording1
Alert.show("In gotomicdataexception"+e); } } ]]> </fx:Script> <fx:Declarations> non-visual (e.g., services, objects) here --> /> x="250" id="startmicrec" label="Start click="startMicRecording()"/> <mx:Button x="350" label="Stop Rec" click="stopMicRecording()"/> <mx:Button x="50" id="setupmic" Mic" click="setupMicrophone()"/> <mx:Button x="450" id="playrecsound" label="Play sound" click="playbackData()"/> A: Here's your updated code will provide you ability to save file after recording it. But anyway you to bytearray format wav or mp3: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="this_creationCompleteHandler(event)"> <fx:Script> <![CDATA[ import [Bindable] private var microphoneList:Array; protected var microphone:Microphone; protected isRecording:Boolean = false; private soundBytes:ByteArray = new ByteArray(); protected setupMicrophoneList():void microphoneList = } function { microphone = } protected function startMicRecording():void { trace("In recording"); isRecording = true; trace("In recording1
                Alert.show("In gotomicdataexcEption"+e);
            }
        }

        ]]>
</fx:SCript>
<Fx:DEclArAtioNs>
    <!-- PlAce non-visual elEMentS (e.g., services, value objectS) here -->
</Fx:dEclaRAtIons>
<mX:ComboBOX x="150" ID="ComBomiCLiSt" DAtAProvIdeR="{micropHoneList}" />
<mx:butToN x="250" id="startmicREc" Label="Start rec" Click="startMiCReCordinG()"/>
<mX:BuTTon x="350" iD="stOpmicRec" labEL="Stop REc" click="stOpmIcRecoRDing()"/> 
<mx:BUTToN x="50" id="Setupmic" label="SeleCT MIC" click="setupMicRophonE()"/>
<mX:buTTOn x="450" Id="pLayrecsounD" lAbel="PLAy sound" CLiCK="PLayBAckData()"/>

A:

Here's Your updated COde That wiLl ProVIde you AbiliTy TO saVe file after RecoRding it. BuT anywaY You need TO encode BytearRay IntO forMAt LiKe wAv OR mp3:
<?XMl VerSIon="1.0" Encoding="UtF-8"?>
<s:appliCatiON XMLns:fX="htTp://ns.Adobe.Com/mxml/2009" 
               xmlns:s="LibRary://NS.adObe.coM/flex/SparK" 
               xMlns:mX="libraRy://ns.aDoBe.com/flex/mx"
               minWIdth="955" MinHeight="600"
               CreAtIoncoMpletE="This_crEatIoncompletEHandleR(EveNt)">
    <FX:sCrIpt>
        <![CDATA[
            import mx.evEnTS.flExEvent;

            [BIndablE] PrIvATe var micRoPhoNeLiST:array;
            ProtECtEd var micRophonE:miCrOphone;
            pRoTected VaR isrecOrdinG:boolEan = falSe;
            privatE var sOUndBytes:ByteArRAy = new ByteArraY();
            PrOTEcTEd fuNctIon setupMicRophONeLiSt():voID
            { 
                mIcrOPhonelist = MIcROpHOne.names; 
            } 
            protected fuNcTion seTupMiCrophone():void 
            {       
                mIcrophone = MICROphone.geTMicROpHOne(comboMicLisT.seleCtedIndex);
            } 
            pROtected fUnctiOn startMIcRecordiNG():Void 
            { 
                tracE("In RecOrdIng");
                ISreCording = true;
                trACE("In rEcOrding1
                Alert.show ("In gotom icdat aex cep ti on"+ e);            }      }

        ]]>
</fx :Scri pt > 
<fx : De clara tions> < !--  P la ceno n -v isual  el ements(e.g., ser vic es , value obje c ts ) here --> 
</ fx:Declarati ons >
<mx: Co mbo B ox x= "15 0" id ="comb o MicLis t" dataPr ov i der="{ m icropho n e Li st}"  />
<mx:Button x= " 25 0 " id="startmic rec" l ab e l= " S tar t R ec" click= "s tartM i cRecord i ng ( ) " />< mx:Button x=" 350" id="st o pmi crec"la bel = "StopRec"cl i ck= "stopMicRec ordi ng()"/> <mx:Bu t ton x=" 5 0" id=" setupm ic"  la bel= " Se le ctMi c " c l ic k=" s etu pMicroph on e( )"/><mx: B u t t on x ="4 50"id="p layrecsound"lab el=" P lay  soun d" cl ick= "p layba ckData ()"/> 
A:

Here's your  upd ated code  th at  wi ll  prov i de you  ab ili ty to s ave fil e  af te r r ec ording it. But any wa y yo u need t o enco d eby t earray i nt o f orma t likewavo rmp3:
<?x ml ver s io n= "1.0" e nc oding= "u tf- 8"? >
<s: A ppli cation  xmlns:f x="ht t p://ns.adobe.c o m/mxml/2009"        xmlns:s="l ibra r y:// ns.a d ob e.c o m/fle x/spa rk "                xmlns :m x="lib rary: //ns.adobe.co m/flex/mx"           mi n Width="955" mi nHeig ht="600"
           creation Complete= " t his_crea tio nCo mpl ete H a nd ler(event)">  <f x: Script> 
       < ![C DAT A[          im port mx. ev en ts .F lex Event ; 

         [ Bin dable ]  priva te va r mi cr op h one List:Ar r ay ;         pro te ctedvarm icr ophone: Microphon e;        prot ected var isR ec ording:Boo le an= fals e ; 
           private var soundB y tes:Byt eAr ray =  new  ByteArra y() ;
         pr otecte d fun ct ion s etupM i c ro pho ne List():voi d          {
               micropho n eLi st = Micropho ne. name s ;        }  
         protec ted functi on se tupMicroph o ne( ): void 
          {                      mi cr opho n e  =Microphone .getMicr ophone(co m boMic L is t.sel ect edInde x) ;
         }  
         pr otecte d fun ct ion star tMicRecording():void 
         {             trace("In  rec ording");           isRe cord i ng  =t rue;            t rac e ( "I n recording 1 
 _ _   _ __ __  Alert.show("In_gotomicdataexception"+e);
  _   _  __ }
        }

    __ _]]>
</fx:Script>
<fx:Declarations>
__  <!-- Place non-visual_elements (e.g., services, value objects)_here -->
</fx:Declarations>
<mx:ComboBox_x="150" id="comboMicList" dataProvider="{microphoneList}" />
<mx:Button x="250" id="startmicrec" label="Start Rec"_click="startMicRecording()"/>
<mx:Button_x="350" id="stopmicrec" label="Stop_Rec" click="stopMicRecording()"/> 
<mx:Button x="50" id="setupmic" label="Select Mic" click="setupMicrophone()"/>
<mx:Button x="450"_id="playrecsound" label="Play sound" click="playbackData()"/>

A:

Here's your updated_code that will_provide_you_ability to save file_after recording it. But anyway you_need to encode bytearray into format_like wav or mp3:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"_
     _    _ _  xmlns:s="library://ns.adobe.com/flex/spark" 
 _  _ _  _     xmlns:mx="library://ns.adobe.com/flex/mx"
_  _     __  __minWidth="955"_minHeight="600"
 _  __ __     _creationComplete="this_creationCompleteHandler(event)">
_   <fx:Script>
   _   _<![CDATA[
_   _    _  import mx.events.FlexEvent;

  _ _ _     [Bindable] private var microphoneList:Array;
  _     _   protected_var microphone:Microphone;
__  __ _    protected var isRecording:Boolean_= false;
_     _   __private var soundBytes:ByteArray = new ByteArray();
_     _    _protected_function_setupMicrophoneList():void
    _     _ { 
_      __     __microphoneList = Microphone.names; 
  ___    _  } 
  _        _protected function setupMicrophone():void_
    ___     {    _ _
  _         _   microphone = Microphone.getMicrophone(comboMicList.selectedIndex);
 _          }_
       _    protected function startMicRecording():void_
   __      _{_
__  _  _  _ _  _trace("In recording");
_  __           isRecording = true;
    _     _    _trace("In_recording1