更改进度条的颜色在弯曲

更改进度条的颜色在弯曲

本文介绍了更改进度条的颜色在弯曲的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何chnage进​​度条的颜色为绿色,在以下code

 < XML版本=1.0编码=UTF-8&GT?;
 < MX:应用
的xmlns:MX =htt​​p://www.adobe.com/2006/mxml
布局=绝对
WIDTH =100
高度=100
的creationComplete =的init()>

< MX:脚本>
    <![CDATA [
        进口mx.controls.Alert;
        进口flash.net.NetStream在;

        私人VAR myMic:麦克风;
        私人VAR数控:的NetConnection;


        私有函数的init():无效{
            initMic(0x19D319);


            myMic = Microphone.getMicrophone();
            myMic.setSilenceLevel(0);
            myMic.rate = 44;
            myMic.gain = 100;
            //myMic.setUseEchoSup$p$pssion(true);
            Security.showSettings(SecurityPanel.MICROPHONE);
            micLevel.visible = TRUE;
            myMic.setLoopBack(真正的);


            的addEventListener(Event.ENTER_FRAME,showMicLevel);
            如果(myMic!= NULL)
            {
                micLevel.setProgress(myMic.activityLevel,100);

            }


        }


        私有函数showMicLevel(事件:事件):无效{
            micLevel.setStyle(barColor,0xf4b60f);

            开关(recordingState){
                案空转:

                    micLevel.setProgress(myMic.activityLevel,100);
                    打破;
                案空转:
                    Alert.show(2);
                    micLevel.setProgress(myMic.activityLevel,100);
                    打破;
                案玩:
                    micLevel.setProgress(ns.time,myDuration);
                    打破;

            }
        }
        私有函数initMic(myColor:字符串):无效{
            micLevel.setStyle(barColor,myColor);
        }

    ]]≥
< / MX:脚本>

< MX:进度条X =0Y =36模式=手动ID =micLevel标签=将labelPlacement =底部WIDTH =100fontSize的=10的fontWeight =正常/ >


 < / MX:用途>
 

解决方案

您有以下属性来控制进度条的外观

  barColor =不确定
barSkin =ProgressBarSkin
BORDERCOLOR =默认值为0xAAB3B3
颜色=0x0B333C
disabledColor =默认值为0xAAB3B3
 

有关详细信息,请参阅文档。

How to chnage progress bar color to green in the following code

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

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

        private var myMic:Microphone;
        private var nc:NetConnection;


        private function init():void {
            initMic("0x19D319");


            myMic = Microphone.getMicrophone();
            myMic.setSilenceLevel(0);
            myMic.rate = 44;
            myMic.gain = 100;
            //myMic.setUseEchoSuppression(true);
            Security.showSettings(SecurityPanel.MICROPHONE);
            micLevel.visible = true;
            myMic.setLoopBack(true);


            addEventListener(Event.ENTER_FRAME, showMicLevel);
            if (myMic != null)
            {
                micLevel.setProgress(myMic.activityLevel, 100);

            }


        }


        private function showMicLevel(event:Event):void{
            micLevel.setStyle("barColor", 0xf4b60f);

            switch (recordingState){
                case "idle" :

                    micLevel.setProgress(myMic.activityLevel, 100);
                    break;
                case "idle" :
                    Alert.show("2");
                    micLevel.setProgress(myMic.activityLevel, 100);
                    break;
                case "playing" :
                    micLevel.setProgress(ns.time, myDuration);
                    break;

            }
        }
        private function initMic(myColor:String):void{
            micLevel.setStyle("barColor", myColor);
        }

    ]]>
</mx:Script>

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


 </mx:Application>
解决方案

You have the following properties to control the appearance of the progress bar

barColor="undefined"
barSkin="ProgressBarSkin"
borderColor="0xAAB3B3"
color="0x0B333C"
disabledColor="0xAAB3B3"

For more detailed information, refer to the documentation.

这篇关于更改进度条的颜色在弯曲的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 06:53