5 Replies Latest reply on Jun 8, 2010 10:32 PM by athiroy

    textinput value transfers one mxml file to another

    athiroy Level 1

      1. personal.mxml
      text input 1 : nametxt
              2:  addresstxt

       

                 3. submit button

       

      2. Family.mxml
      text input 1 : fathernametxt
              2:  mothernametxt

       


      ther user enter first personal.mxml
      he give the name and address then he selects submit button

       

      when submit button clicks it navigates
      http://localhost:8080/StudentRegistration/html/Family.html(Family.swf)

       

      then the user enter Fathername and mothername.
      here i want to transfer to uservo.as file
         nametxt, addresstxt,faternametxt,mothernametxt.
         but i cant get nametxt and addresstxt in Family.mxml

       

       

       

       

      anybody help me

       

      regards

      adhi

        • 1. Re: textinput value transfers one mxml file to another
          David_F57 Level 5

          hi,

           

          You can use shared objects they are like cookies, you save the data to the localdrive then the second swf can open the data.

           

          for a simple example of writing and reading shared objects look at the code of this example

           

          http://gumbo.flashhub.net/login/

           

          As you can see the mxml saves the data to a shared object, if you look at the creationcomplete you will see it reads the shared object so if it is there the information is available otherwise it will create the object. Writing (flush) of a shared object will store any data you want.

           

          David.

          1 person found this helpful
          • 2. Re: textinput value transfers one mxml file to another
            athiroy Level 1

            hi

             

            thnks for ur help

            i want to know how to retrive that shared object in another mxml file

             

            advance thanks

             

            regards

            athi

            • 3. Re: textinput value transfers one mxml file to another
              David_F57 Level 5

              hi,

               

              This is how it would work for your application, in the first mxml place the 'save' code into your submit function

               

              so in the first mxml

               

                          private function updateDetails():void
                          {
              
                                  var MyID:SharedObject = SharedObject.getLocal("SavedAddress","/");
              
              MyID.data.address = inputAddress.text;             }

              in the second applications mxml
                          protected function app_creationCompleteHandler(event:FlexEvent):void
                          {
                              var MyID:SharedObject = SharedObject.getLocal("SavedAddress","/");
                              address.text = MyID.data.address;             }

              • 4. Re: textinput value transfers one mxml file to another
                David_F57 Level 5

                hi,

                 

                stupid forum ate the code.....

                 

                first application add this to the submit routine

                 

                private function updateDetails():void

                {

                   var MyID:SharedObject = SharedObject.getLocal("SavedAddress","/");

                   MyID.data.address = inputAddress.text;

                   MyID.flush();

                }

                 

                second application have this in the creationcomplete routine

                 

                protected function app_creationCompleteHandler(event:FlexEvent):void

                {

                     var MyID:SharedObject = SharedObject.getLocal("SavedAddress","/");

                     address.text = MyID.data.address;

                }

                • 5. Re: textinput value transfers one mxml file to another
                  athiroy Level 1

                  hi

                   

                  i got output

                   

                  thanks a lot

                   

                  regards

                  adhi