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 dispTemp:Number = 72; private var sourceFTemp:Number = 72; private function goFahrenheit():void { dispTemp = sourceFTemp; } private function goCelsius():void { dispTemp = (5/9) * (sourceFTemp - 32); } </mx:Script> <mx:Panel x="10" y="10" width="200" height="250" layout="absolute" title="Temp Conversion Binding"> <mx:VBox x="10" y="10" height="100%"> <mx:Label id="lblOutput" text="{String(dispTemp)}"/> <mx:Button label="Change Fahrenheit" id="bChangeF" click="{goFahrenheit()}"/> <mx:Button label="Change Celsius" id="bChangeC" click="{goCelsius()}"/> </mx:VBox> </mx:Panel> </mx:Application>