I had used a property 'barColor' in ProgressBar component for showing performance with filling colours. Now I am moving the application to Flex 4. So this property is not available in Flex 4. Can you please any one known about the alternative for the barColor
property. Spark is not supporting this property.
<mx:ProgressBar xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="100%" x="0" y="0"
height="20"
label=""
labelPlacement="center"
minimum="0"
id="iops"
maximum="1000"
mode="manual"
barSkin="{progressSkin}">
And ProgressSkin class:-
<fx:Metadata>
[HostComponent("progressBarComponent")]
</fx:Metadata>
<fx:Script>
<![CDATA[
override protected function initializationComplete():void {
useChromeColor = true;
super.initializationComplete();
}
]]>
</fx:Script>
<s:Rect top="0" right="0" left="0" bottom="0" id="green" includeInLayout="{hostComponent.color==0x94CF65}">
<s:fill >
<s:SolidColor color="0x94CF65" />
</s:fill>
</s:Rect>
<s:Rect top="0" right="0" left="0" bottom="0" includeInLayout="{hostComponent.color==0xFFDE53}">
<s:fill>
<s:SolidColor color="0xFFDE53" />
</s:fill>
</s:Rect>
<s:Rect top="0" right="0" left="0" bottom="0" includeInLayout="{hostComponent.color==0xFF9428}">
<s:fill>
<s:SolidColor color="0xFF9428" />
</s:fill>
</s:Rect>
I have 3 colors in the skin class. I want to use this color based on the progressBar value. Can you please help on the same, how to display the different color by using same skin in Progressbar.
First we need to write a progressbar class and extend the progress bar class
ColorChangingProgressBar.as
And next Write a skin class for the progress bar.
ColorChangingProgressBarBarSkin.mxml
and need to add the skin class to the application.
ProgressBarExample.mxml
This example will work.