Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 更改flex中spark进度条的文本_Actionscript 3_Apache Flex_Actionscript_Progress Bar - Fatal编程技术网

Actionscript 3 更改flex中spark进度条的文本

Actionscript 3 更改flex中spark进度条的文本,actionscript-3,apache-flex,actionscript,progress-bar,Actionscript 3,Apache Flex,Actionscript,Progress Bar,我认为这很容易,但在实施过程中遇到困难。 我在我的项目中添加了进度条,它将显示下载过程 我要将进度条的文本从加载20%更改为下载20%。我在代码中做了如下更改,正如我在某处看到的那样 <mx:ProgressBar mode="manual" labelPlacement="center" label="Downloading 0%" /> 它会将标签更改为下载,但不会在过程中更改百分比。仍然是0%

我认为这很容易,但在实施过程中遇到困难。
我在我的项目中添加了进度条,它将显示下载过程

我要将进度条的文本从
加载20%
更改为
下载20%
。我在代码中做了如下更改,正如我在某处看到的那样

<mx:ProgressBar mode="manual" labelPlacement="center" label="Downloading 0%" />

它会将标签更改为下载,但不会在过程中更改百分比。仍然是0%<我不知道为什么?我错在哪里


谢谢,

将事件处理程序添加到
ProgressBar
progress=“progressHandler(event)”

private function progressHandler(event:ProgressEvent):void
{
    var percent:int = Math.round(event.bytesLoaded / event.bytesTotal * 100);
    idOfProgressBar.label = "Downloading " + percent + "%";
}