Wally,

You are looking for the close event on the ComboBox. Take a look at 
the code below.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; 
layout="absolute">
        <mx:states>
                <mx:State name="State2">
                        <mx:AddChild position="lastChild">
                                <mx:Label x="234" y="39" 
text="State2" width="167" fontWeight="bold" textAlign="center" 
fontSize="20"/>
                        </mx:AddChild>
                        <mx:RemoveChild target="{stateC}"/>
                </mx:State>
        </mx:states>
<mx:Script>
        <![CDATA[
                public function changeState():void {
                        if (stateCB.selectedItem.data==2){
                                currentState='State2';
                        }
                }
        ]]>
</mx:Script>    
        <mx:ComboBox id="stateCB" x="73" y="64" close="changeState()">
                <mx:ArrayCollection>
                        <mx:Object label="--" data="1"/>
                        <mx:Object label="State 2" data="2"/>
                </mx:ArrayCollection>

        </mx:ComboBox>
        
</mx:Application>


Reply via email to