R – Flex Calculator Widget

actionscript-3apache-flex

I am looking for a "flex" calculator open source widget.

Can anyone help me out with this?

Regards
Zeeshan

Best Answer

I take no credit for this. Scalped from http://codingforums.com/showthread.php?t=164998

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">

<mx:Script>
    <![CDATA[

        private function getTotal():void
        {
            var myInt:int = parseInt(input.text);
            var myFloat:Number = parseFloat(input.text);
            var myNumber:Number = new Number(input.text);

            total.data = (myNumber - 1) + (radioGroup.selectedValue);
        }

    ]]>
</mx:Script>



    <mx:RadioButtonGroup id="radioGroup"/>
    <mx:RadioButton label="1 - 4" groupName="radioGroup" value="3.50"/>
    <mx:RadioButton label="5 - 8" groupName="radioGroup" value="5.25"/>
    <mx:TextInput id="input" restrict="0-9" />
    <mx:TextInput id="total"/>
    <mx:Button label="Button" click="getTotal();"/>

</mx:Application>
Related Topic