0 Replies Latest reply on Feb 28, 2010 10:38 PM by satheeshpallath12

    Error in Code?-PlZ Check This

    satheeshpallath12 Level 1

      Hai,

       

      We are getting an error in this code.We are beginners in Flex.

      Can anyone help us?

       

      This is our code....

       

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

       

          <![CDATA[
              import flash.media.Camera;
              import flash.media.Microphone;
             
             
              private function init():void
              {
                  cam.dataProvider=Camera.names;
                  mic.dataProvider=Microphone.names;
                 
              }
              private function send():void
              {
                  //var camera:Camera=Camera.getCamera();
             
                  var micro:Microphone=Microphone.getMicrophone();
                  micro.addEventListener(StatusEvent.STATUS, this.onMicStatus);

       

                  private function onMicstatus(event:StatusEvent):void
                  {
                      if(event.code == "Microphone.Unmuted")
                      {
                          trace("Microphone access allowed");
                         
                      }
                      else if(event.code == "Microphone.Muted")
                      {
                          trace("Microphone access denied");
                      }
                  }
              }
          ]]>
      </mx:Script>

       

          <mx:Panel x="265" y="50" width="294" height="200" layout="absolute">
              <mx:VideoDisplay x="0" y="0" width="274" height="160"/>
          </mx:Panel>
          <mx:Button x="381.5" y="314" label="Start" click="send()"/>
          <mx:Text x="281" y="24" text="Username" id="uname"/>
          <mx:TextArea x="351" y="24" height="18" width="150"/>
          <mx:Text x="281" y="260" text="Camera" width="62"/>
          <mx:ComboBox x="351" y="258" width="191" id="cam"></mx:ComboBox>
          <mx:Label x="273" y="286" text="microphone"/>
          <mx:ComboBox x="351" y="284" width="191" id="mic"></mx:ComboBox>
         
      </mx:Application>

       

      ERROR:-

       

      1013: The private attribute may be used only on class property definitions.    videovoice/src    videovoice.mxml    line 23    1267425378537    662