6 Replies Latest reply on Apr 7, 2010 6:09 PM by David_F57

    mxml component application

    ifthyakar

      Hi all,

       

      I am converting a asp.net website to Flex, I have five web pages which I designed as Five mxml components have buttons, grid, combos, text boxes etc.

      my question is how do I move between these pages they are distinct in there looks and functionality. I read a lot about view states and I am confused whether view states will solve my issue.

       

      Please tell me how do we handle this usually in flex applications.

        • 1. Re: mxml component application
          David_F57 Level 5

          hi,

           

          someone else asked this question a few days ago, i created a simple example for them, the link is below

           

           

          http://gumbo.flashhub.net/forms/   source enabled

          David

          • 2. Re: mxml component application
            ifthyakar Level 1

            Thanks for the help but, Sorry forgot to mention. I am using Flex3. And need pure Flex3 example or explanation without using 3rd party frameworks.

            • 3. Re: mxml component application
              JeffryHouser Level 4

              I took a look at David's example; and am kind of confused by your response.

               

              He doesn't appear to have any dependencies on 3rd party frameworks.  If the sample David just provided to you isn't what you wnt; can you explain why; or further clarify your problem.

              • 4. Re: mxml component application
                David_F57 Level 5

                Hi,

                 

                Flex 4 or Flex 3 the answer remains the same, I have a state for each form then I place a container, be it a group a canvas or a panel, in each state to show how states work, the following is in flex 3

                 

                The Application

                ============

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

                <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600" currentState="form1" xmlns:ns1="*">

                <mx:states>

                <mx:State name="form1">

                <mx:AddChild position="lastChild">

                <ns1:form1 horizontalCenter="0" verticalCenter="0">

                </ns1:form1>

                </mx:AddChild>

                </mx:State>

                <mx:State name="form2">

                <mx:AddChild position="lastChild">

                <ns1:form2 horizontalCenter="0" verticalCenter="0">

                </ns1:form2>

                </mx:AddChild>

                </mx:State>

                <mx:State name="form3">

                <mx:AddChild position="lastChild">

                <ns1:form3 horizontalCenter="0" verticalCenter="0">

                </ns1:form3>

                </mx:AddChild>

                </mx:State>

                </mx:states>

                <mx:Button label="Form 1" click="currentState='form1'" top="10" horizontalCenter="-150"/>

                <mx:Button label="Form 2" click="currentState='form2'" top="10" horizontalCenter="0"/>

                <mx:Button label="Form 3" click="currentState='form3'" top="10" horizontalCenter="150"/>

                </mx:Application>

                 

                The Mxml Component Container (which is exactly what you said you had)

                 

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

                <mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" height="300" title="First Form">

                 

                </mx:Panel>

                 

                 

                You can navigate through your 'pages' however you want to, the first example I offered is pure flex the above code is pure flex only using the antiquated sdk which I would advise against for 'new' projects, flex 3 sdk maybe used in flashbuilder but I would only go to this for legacy purposes using the flex 4 sdk is by far the better option.

                 

                I try to help where I can, there is no reward for doing this, but I did answer your initial question about states, I hope you get to understand flex a little better with time.

                 

                David.

                 

                 

                • 5. Re: mxml component application
                  ifthyakar Level 1

                  David

                   

                  Thanks, I am new to flex and I had no knowledge of the sdk you used. I hope I did'nt sound authoratativy in my reply.

                   

                  Thanks again.

                  • 6. Re: mxml component application
                    David_F57 Level 5

                    Hi,

                     

                    We all have to start at some point , I would suggest strongly that you try to gain knowledge with a preference to the latest that flex/flashbuilder offer.

                     

                    There are great video tutorials on Adobe connect and it is a good place to go to get an understanding of just what flex has to offer.

                     

                     

                    David.