2 Replies Latest reply on Feb 8, 2012 6:08 AM by ksukat

    Newbie - Views

    ksukat Level 1

      greetings,

      have flashbuilder 4.5 for php premium.   Am just starting with Flex.

       

      I am creating an application that has many forms (not flex forms, but forms as in screens).

      My application has a series of customer mxml components (buttons) on it. 

      Each button mxml component has several states (state1 is the button, state2 is boxes, datagrid, etc).

      The problem I am experiencing is that buttons from the main are showing when the states of the buttons are shown.

       

      How can I control this ?  I know its not clear, but I can't clarify.  I can post code if that helps.

       

      RTFM is ok too, just point me to the relevant docs.

       

      thanks.

        • 1. Re: Newbie - Views
          drkstr_1 Level 4

          There could be many reasons.

           

          Post some code.

          • 2. Re: Newbie - Views
            ksukat Level 1

            Ok.

             

            My application mxml file:

            <?xml version="1.0" encoding="utf-8"?>

            <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                           xmlns:s="library://ns.adobe.com/flex/spark"

                           xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:component="component.*"

                           currentState="login">

                <s:states>

                    <s:State name="State1"/>

                    <s:State name="login"/>

                </s:states>

                <fx:Declarations>

                    <!-- Place non-visual elements (e.g., services, value objects) here -->

                </fx:Declarations>

                <s:BorderContainer width="928" height="590" cornerRadius="20">

                    <component:T4Header width="100%"/>

                    <component:T4Main includeIn="State1"/>

                    <s:Panel includeIn="login" x="256" y="189" width="352" height="267" title="Login">

                        <s:Label x="20" y="10"  fontSize="16" text="Technician"/>

                        <s:ComboBox id="techCombo" x="95" y="53" prompt="Choose Technician">

                            <s:dataProvider>

                                <mx:ArrayList>

                                    <fx:String>Joe</fx:String>

                                    <fx:String>Mary</fx:String>

                                    <fx:String>Ted</fx:String>

                                    <fx:String>George</fx:String>

                                    <fx:String>Richard</fx:String>

                                </mx:ArrayList>

                            </s:dataProvider>

                        </s:ComboBox>

                        <s:Button x="130" y="153" height="39" label="Go" click="currentState='State1'"

                                  cornerRadius="10"/>

                       

                    </s:Panel>

                </s:BorderContainer>

            </s:Application>

             

            My T4Main mxml component

            <?xml version="1.0" encoding="utf-8"?>

            <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"

                     xmlns:s="library://ns.adobe.com/flex/spark"

                     xmlns:mx="library://ns.adobe.com/flex/mx"

                     xmlns:component="component.*"

                     width="694" height="382" >

                <s:states>

                    <s:State name="State1"/>

                </s:states>

                <fx:Declarations>

                    <!-- Place non-visual elements (e.g., services, value objects) here -->

                </fx:Declarations>

               

               

                <component:AnimalBtn id="AnimBtn" y="150"/>

                <component:T4_ActionBtn id="ActBtn" x="101" y="150"/>

                <component:T4_Reports id="RptBtn" x="202" y="150"/>

                <component:Tools id="ToolsBtn" y="210" />

                <component:T4Setup id="OptionBtn" x="101" y="210" />

                <component:Logout id="LogoutBtn" x="101" y="270" />

               

            </s:Group>

             

            My AnimalBtn mxml component

             

            <?xml version="1.0" encoding="utf-8"?>

            <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"

                     xmlns:s="library://ns.adobe.com/flex/spark"

                     xmlns:mx="library://ns.adobe.com/flex/mx"

                     xmlns:component="component.*"

                     width="106" height="80"

                     width.FeedSettings="1190" height.FeedSettings="630"

                     width.justme="1190" height.justme="630">

               

                <fx:Script>

                    <![CDATA[

                       

                    ]]>

                </fx:Script>

               

                <s:states>

                    <s:State name="AnimalStart"/>

                    <s:State name="justme"/>

                    <s:State name="FS"/>

                </s:states>

                <fx:Declarations>

                    <!-- Place non-visual elements (e.g., services, value objects) here -->

                </fx:Declarations>

                <s:Button includeIn="AnimalStart" x="5" y="10" width="93" height="55" label="Animal"

                          click="currentState=&quot;justme&quot;" cornerRadius="10"/>

                <s:Button includeIn="FeedSettings,justme" x="40" y="150" height="57" label="A List"

                          cornerRadius="10"

                          click.FeedSettings="currentState=&quot;justme&quot;"

                          enabled.justme="false"/>

                <s:Button includeIn="FS,justme" x="40" y="209" height="55" label="F Set"

                          cornerRadius="10"

                          enabled.FS="false"

                          click.justme="currentState=&quot;FS&quot;"/>

                <s:DataGrid includeIn="justme" x="191" y="150" width="626" height="279" requestedRowCount="4">

                    <s:columns>

                        <s:ArrayList>

                            <s:GridColumn dataField="dataField1" headerText="Column 1"></s:GridColumn>

                            <s:GridColumn dataField="dataField2" headerText="Column 2"></s:GridColumn>

                            <s:GridColumn dataField="dataField3" headerText="Column 3"></s:GridColumn>

                        </s:ArrayList>

                    </s:columns>

                    <s:typicalItem>

                        <fx:Object dataField1="Sample Data" dataField2="Sample Data" dataField3="Sample Data"></fx:Object>

                    </s:typicalItem>

                    <s:ArrayList>

                        <fx:Object dataField1="data1" dataField2="data1" dataField3="data1"></fx:Object>

                        <fx:Object dataField1="data2" dataField2="data2" dataField3="data2"></fx:Object>

                        <fx:Object dataField1="data3" dataField2="data3" dataField3="data3"></fx:Object>

                        <fx:Object dataField1="data4" dataField2="data4" dataField3="data4"></fx:Object>

                    </s:ArrayList>

                </s:DataGrid>

                <s:Button includeIn="FeedSettings,justme" x="40" y="266" height="55" label="P Sum" cornerRadius="10"/>

                <s:Button includeIn="FeedSettings,justme" x="40" y="323" height="55" label="General" cornerRadius="10"/>

                <s:Button includeIn="FeedSettings,justme" x="40" y="379" height="55" label="EDaList" cornerRadius="10"/>

                <s:Button includeIn="FeedSettings,justme" x="117" y="379" height="55" label="FSstag" cornerRadius="10"/>

                <s:Button includeIn="FeedSettings,justme" x="117" y="150" height="55" label="EDaChrt" cornerRadius="10"/>

                <s:Button includeIn="FeedSettings,justme" x="117" y="209" height="55" label="FDaList" cornerRadius="10"/>

                <s:Button includeIn="FeedSettings,justme" x="117" y="266" height="55" label="FDaChrt" cornerRadius="10"/>

                <s:Button includeIn="FeedSettings,justme" x="117" y="323" height="55" label="FSloc" cornerRadius="10"/>

                <s:Button includeIn="justme" x="824" y="150" height="57" label="New" cornerRadius="10"/>

                <s:Button includeIn="justme" x="824" y="209" height="55" label="Edit" cornerRadius="10"/>

                <s:Button includeIn="justme" x="824" y="266" height="55" label="Delete" cornerRadius="10"/>

                <s:Button includeIn="justme" x="824" y="323" height="55" label="Update" cornerRadius="10"/>

                <s:Button includeIn="justme" x="824" y="379" height="55" label="Done"

                          click="currentState=&quot;AnimalStart&quot;" cornerRadius="10"/>

                <s:BorderContainer includeIn="FS,justme" x="40" y="10" width="854" height="129"

                                   cornerRadius="19" dropShadowVisible="false"

                                   backgroundColor.FeedSettings="#CCCCCC"

                                   backgroundColor.justme="#CCCCCC">

                    <s:Label x="20" y="10" fontSize="18" text="Visual ID"/>

                    <s:Label x="20" y="40" fontSize="18" text="RFID"/>

                    <s:TextInput x="114" y="5"/>

                    <s:TextInput x="114" y="35"/>

                    <s:Label x="264" y="10" fontSize="18" text="Condition"/>

                    <s:Label x="268" y="40" fontSize="18" text="Parity"/>

                    <s:TextInput x="362" y="5" width="44"/>

                    <s:TextInput x="362" y="36" width="44"/>

                    <s:DataGrid x="362" y="66" width="301" height="48" requestedRowCount="4">

                        <s:columns>

                            <s:ArrayList>

                                <s:GridColumn dataField="dataField1" headerText="Location 1"></s:GridColumn>

                                <s:GridColumn dataField="dataField2" headerText="Location 2"></s:GridColumn>

                                <s:GridColumn dataField="dataField3" headerText="Location 3"></s:GridColumn>

                            </s:ArrayList>

                        </s:columns>

                        <s:typicalItem>

                            <fx:Object dataField1="Sample Data" dataField2="Sample Data" dataField3="Sample Data"></fx:Object>

                        </s:typicalItem>

                        <s:ArrayList>

                            <fx:Object dataField1="data1" dataField2="data1" dataField3="data1"></fx:Object>

                            <fx:Object dataField1="data2" dataField2="data2" dataField3="data2"></fx:Object>

                            <fx:Object dataField1="data3" dataField2="data3" dataField3="data3"></fx:Object>

                            <fx:Object dataField1="data4" dataField2="data4" dataField3="data4"></fx:Object>

                        </s:ArrayList>

                    </s:DataGrid>

                    <s:Label x="478" y="9" fontSize="18" text="State"

                             x.FeedSettings="474" y.FeedSettings="6" text.FeedSettings="Status"

                             x.justme="473" y.justme="8" text.justme="Status"/>

                    <s:TextInput x="529" y="4" width="134"/>

                    <s:Button x="680" y="3" height="57" label="New" cornerRadius="10"/>

                    <s:Button x="762" y="3" height="57" label="Delete" cornerRadius="10"/>

                    <s:Button x="10" y="93" label="|&lt;" fontSize="14"/>

                    <s:Button x="82" y="93" label="&lt;" fontSize="14"/>

                    <s:Button x="154" y="93" label="&gt;" fontSize="14"/>

                    <s:Button x="226" y="93" label="&gt;|" fontSize="14"/>

                    <s:Button x="724" y="64" height="57" label="Find" cornerRadius="10"/>

                </s:BorderContainer>

                <s:BorderContainer includeIn="FS" x="195" y="150" width="699" height="281"

                                   cornerRadius="20">

                    <s:Label x="26" y="16" fontSize="14" text="F Curve"/>

                    <s:Spinner x="120" y="10"/>

                    <s:TextInput x="207" y="11" width="407"/>

                    <s:TextInput x="153" y="11" width="36"/>

                    <s:DataGrid x="120" y="41" height="78" requestedRowCount="4">

                        <s:columns>

                            <s:ArrayList>

                                <s:GridColumn dataField="dataField1" headerText="        "></s:GridColumn>

                                <s:GridColumn dataField="dataField2" headerText="Total"></s:GridColumn>

                                <s:GridColumn dataField="dataField3" headerText="Balance"></s:GridColumn>

                            </s:ArrayList>

                        </s:columns>

                        <s:typicalItem>

                            <fx:Object dataField1="Sample Data" dataField2="Sample Data" dataField3="Sample Data"></fx:Object>

                        </s:typicalItem>

                        <s:ArrayList>

                            <fx:Object dataField1="Feed1" dataField2="10" dataField3="3"></fx:Object>

                            <fx:Object dataField1="Feed2" dataField2="5" dataField3="1"></fx:Object>

                        </s:ArrayList>

                    </s:DataGrid>

                    <s:Button x="26" y="139" height="31" label="Over-ride Feed Curve"/>

                    <s:Label x="80" y="189" fontSize="14" text="Feed 1"/>

                    <s:TextInput x="180" y="181" width="36"/>

                    <s:Spinner x="153" y="180"/>

                    <s:Label x="80" y="224" fontSize="14" text="Feed 2"/>

                    <s:TextInput x="180" y="216" width="36"/>

                    <s:Spinner x="153" y="215"/>

                </s:BorderContainer>

            </s:Group>

             

            here is some code.

            Problem is that when I click the AnimalBtn,

            it shows the justme state, but the Action, Reports,Tools, Options and Logout buttons are still visible.

             

             

            thanks for any tips.