<mx:Application creationComplete="update()"
xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute">
<mx:Script>
        <![CDATA[
                [Bindable]
                public var values: Array = [1,2,3,4,5,6,7,8,9,10];
                public var total:Number;
                
                public function update():void
                {
                        if(operation.text == "*")
                        {total = boxOne.selectedItem.valueOf() * 
boxTwo.selectedItem.valueOf()}
                        else if(operation.text == "/")
                        {total = boxOne.selectedItem.valueOf() / 
boxTwo.selectedItem.valueOf()}
                        else if(operation.text == "+")
                        {total = boxOne.selectedItem.valueOf() + 
boxTwo.selectedItem.valueOf()}
                        else if(operation.text == "-")
                        {total = boxOne.selectedItem.valueOf() - 
boxTwo.selectedItem.valueOf()}
                        
                        texttotal.text = total.toString();
                }
                ]]>
    </mx:Script>
<mx:HBox>
        <mx:ComboBox change="update()" id="boxOne" dataProvider="{values}"
rowCount="{values.length}"/>
        <mx:TextInput change="update()" id="operation" text="*" width="20"/>
        <mx:ComboBox change="update()" id="boxTwo" dataProvider="{values}"
rowCount="{values.length}"/>
        <mx:Label id="texttotal"/>
</mx:HBox>
</mx:Application>

not the best example but it works.

--- In flexcoders@yahoogroups.com, "Akash" <[EMAIL PROTECTED]> wrote:
>
> 
> Hi,
> 
>  
> 
>        I have 2 comboBoxes, a text area and a label. Whenever a change
> occurs in any of the above said controls the resultant value of the
label
> should come accordingly on the fly. Can anybody Tell me some example
of this
> kind.
> 
>  
> 
> Looking Forward to your cooperation,
> 
>  
> 
> Akash
> 
> 
> 
> Disclaimer
> 
> This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom it is
addressed.  If you have received this communication in error, please
immediately notify the [EMAIL PROTECTED] and destroy the original message.
The recipient should check this email and any attachments for the
presence of viruses.  Ness has taken every reasonable precaution to
minimize this risk, and accepts no liability for any damage caused by
any virus transmitted in this email.  Ness reserves the rights to
monitor and review the content of all messages sent to or from this
E-mail address, and store them on the Ness E-mail system.
>




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to