Inline Celsius and Fahrenheit converter : Label « Components « Flex
- Flex
- Components
- Label
Inline Celsius and Fahrenheit converter

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
[Bindable]
private var sourceCTemp:Number;
</mx:Script>
<mx:Binding source="curSlider.value" destination="sourceCTemp" />
<mx:Panel x="10" y="10" width="300" height="250" layout="absolute" title="Temp Coversion Binding">
<mx:VBox x="10" y="10" height="100%">
<mx:Label id="dispF" text="{'Celsius:' + String(sourceCTemp)}"/>
<mx:Label id="dispC" text="{'Fahrenheit:' + String((9/5) * sourceCTemp + 32)}"/>
<mx:HSlider id="curSlider" minimum="0" maximum="100"/>
</mx:VBox>
</mx:Panel>
</mx:Application>
Related examples in the same category