1 Reply Latest reply on Jun 11, 2007 10:13 PM by parallaxed

    Using Events Through States

      I'm having trouble passing some values from one state to another. More specifically, I'm trying to change the .text value on a different state based on the choice from the user on a ComboBox.

      What I'm trying is:


      private function PriceCheck():void

      Choice1.text = HotelFirst.selectedLabel;

      The ComboBox is in the state "Choice" with the following declaration:

      <mx:ComboBox x="54" y="43" id="HotelFirst" dataProvider="{hotels}" fontSize="10" creationComplete="PriceCheck()" change="PriceCheck()" >

      Then the Text box, which I'm wanting to display the label of the ComboBox choice on is declared in the state "Confirm" as follows:

      <mx:Text x="151" y="237" fontSize="12" color="#808080" id="Choice1" text="{Hotel1}"/>

      Anyone have any ideas?

        • 1. Re: Using Events Through States
          You're setting text in the function declaration. Given that's there, you shouldn't need the binding in Choice1 for anything.

          The states (IIRC), shouldn't interfere with you setting the property, unless the component hasn't been added to the display at the time you set the property. Simply make sure you enter the right state before setting properties on components in that state.

          Without a full code snip, it's difficult to see if anything else is wrong. Post some chunks of your state code if you're still having trouble.