1 Reply Latest reply on Sep 16, 2010 6:25 AM by jen1107

    flex 4 not supporting state component..?

    Ling's Level 1

      Hi all.,

      I have using state component in flex 4.

      but. error displayed


      State overrides may no longer be explicitly declared. The legacy states syntax has been deprecated

       

      <mx:states>


              <s:State name="expaneded">


                    <mx:AddChild position="lastChild">
                      <mx:VBox>
                          <s:Label id="lbl_searchfield"   paddingLeft="30" text="Search Field" color="white"  />
                          <s:Label id="lbl_searchvalue"  paddingLeft="180" text="Search Value"  color="white" />
                          <s:Label id="lbl_searchflltext"  paddingLeft="270" text="Search FullText"  color="white" />
                      </mx:VBox>
                  </mx:AddChild>
                 
              </s:State>
          </mx:states>

       

      how to solve this problem., any one help me..

       

      regards

      Ling's

        • 1. Re: flex 4 not supporting state component..?
          jen1107

          Hi,

          AddChild is deprecated in Flex 4. Instead use includeIn, that'll be an attribute of <s:Label> with value, "state_name".

           

          Example:

          <mx:states>

           

          <s:State name="expaneded"/>

           

          </mx:states>

           

          <mx:VBox>

           

           

               <s:Label id="lbl_searchfield" paddingLeft="30" text="Search Field" color="white" includeIn="expaneded"/>

           

           

               <s:Label id="lbl_searchvalue" paddingLeft="180" text="Search Value" color="white" includeIn="expaneded"/>

           

           

           

               <s:Label id="lbl_searchflltext" paddingLeft="270" text="Search FullText" color="white" includeIn="expaneded"/>

           

           

           

          </mx:VBox>

           

           

          Check this out:

          http://opensource.adobe.com/wiki/display/flexsdk/Enhanced+States+Syntax