Could someone help me figure out how to get the hslide value in Flash Builder to have an extra zero if the value is below 10? The problem is that I need to get a two digit value out from the hslide, but if I put in the min/max values 0-23 I will only get one digit if the value is below 10.
Example: I want to use the hslide as a time slide. If I choose 4am I need the value to be 04, not 4.
Below is my example code, it is the hslider1.value and hslider2.value that needs to be two digits.
<fx:Script>
<![CDATA[
protected function button1_clickHandler(event:MouseEvent):void
{ navigateToURL(new URLRequest("tel:*23*"+hslider1.value+hslider2.value)) ;
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Button y="155" width="269" height="80" label="Button" click="button1_clickHandler(event)"
color="#FFFFFF" enabled="true" fontSize="24" horizontalCenter="0"/>
<s:HSlider id="hslider1" top="405" width="90%" height="30" dataTipPrecision="0"
horizontalCenter="0" liveDragging="true" maximum="23" minimum="0" stepSize="1" />
<s:HSlider y="469" width="90%" height="30" id="hslider2"
horizontalCenter="1" liveDragging="true" maximum="55" minimum="0" stepSize="5" dataTipPrecision="0"/>
<s:Label x="88" y="291" width="194" height="22" fontSize="24"
text="{hslider1.value}" textAlign="right"/>
<s:Label x="284" y="291" width="7" height="22" fontSize="24" text=":"/>
<s:Label x="294" y="291" width="194" height="22" fontSize="24" text="{hslider2.value}"/>
Any type of help would be deeply appreciated!
Best regards from Camilla in Sweden.
hi just replace the button1_clickhandler function with the following one..
Have a Nice Day…