1 Reply Latest reply on Oct 10, 2012 5:08 AM by Supreet R

    How can i pass values from one to another mxml page?

    Keyur_Shah

      I wan t pass values of one page into another page. Please help me. I am new to flex.

        • 1. Re: How can i pass values from one to another mxml page?
          Supreet R Level 1

          Hi Shah,

           

          We can pass the values in the following ways,

           

          1. Use Model concept

              Create a 'Model' class with a variable which is 'Bindable' and 'public' that holds the value you want to exchange between mxml files(this variable is accessible to entire application).

              Create an instance of model class and update this variable in the mxml which has the value.

              Create an instance of model class in another mxml and get the value of the variable wrt to the model class instance.

             

          2. Use Custom events

              Create a custom event which will store the required value.

              Dispatch this custom event in the mxml which has the value.

              Listen to this custom event in another mxml where you want to access the required value and get the value once the event is triggered.

           

          Thanks,

          Supreet R