1 Reply Latest reply on Jan 27, 2010 6:31 PM by Shongrunden

    Flash Builder 4 sending values from one mxml to another mxml

    StealthRTTT

      Hey all, as the title says, i need help figuring out how to send some values from one of my mxml files to another one. I'll break it down like this:

       

      First.mxml

      Second.mxml

       

      Now i gather all my values from the First.mxml file and i want to send those values to the Second.mxml. I am unable to find how to go about doing this. I have 2 text boxes on the Second.mxml file that needs to have the 2 values from First.mxml insurting inside them. The textboxes id's are called ti_email and ti_passw.

       

      Any help would be great!

       

      David

        • 1. Re: Flash Builder 4 sending values from one mxml to another mxml
          Shongrunden Adobe Employee

          One very basic way would be to define some public properties on Second and pass them in from First:

           

          First.mxml

          <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                         xmlns:s="library://ns.adobe.com/flex/spark"
                         xmlns:local="*">
             
              <local:Second firstValue="hello" secondValue="world" />
             
          </s:Application>

           

          Second.mxml

          <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark">
             
              <fx:Script>
                  <![CDATA[
                      [Bindable] public var firstValue:String;
                      public var secondValue:String;
                  ]]>
              </fx:Script>

              <s:Button label="{firstValue}" />
             
          </s:Group>

           

           

          Is this what you are looking for?