对于activitylevel Flex的ActionScript代码(Flex actionscr

2019-11-04 10:33发布

任何一个可以indicata我让于MIC activitylevel这个进度条移动一小块代码。 即,当麦克风发言的进度应说明it.Also其在Internet Explorer工作

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

<mx:Script>
<![CDATA[
 import mx.controls.Alert;
 import flash.net.NetStream;

 private var myMic:Microphone;
 private var recordingState:String = "idle";

 private function init():void {

    myMic = Microphone.getMicrophone();
    myMic.setSilenceLevel(0);
    myMic.rate = 44;
    myMic.gain = 100;

    micLevel.visible = true;
    Security.showSettings(SecurityPanel.MICROPHONE);
    myMic.setLoopBack(true);
    if (myMic != null)
    {
       myMic.setUseEchoSuppression(true);
       micLevel.setProgress(myMic.activityLevel, 100);
       addEventListener(Event.ENTER_FRAME, showMicLevel);
       //micLevel.setProgress(myMic.activityLevel, 100);
    }

 }



]]>
 </mx:Script>

<mx:ProgressBar x="0" y="36" mode="manual" id="micLevel" label="" labelPlacement="bottom" width="100" fontSize="10" fontWeight="normal"/>

</mx:Application>

Answer 1:

您需要添加一个回调函数的事件。 你把它定义为showMicLevel但你有没有实现该功能的。

   private function showMicLevel(e: Event):void{
      micLevel.setProgress(myMic.activityLevel, 100);
   }


文章来源: Flex actionscript code for activitylevel