1 Reply Latest reply on Apr 5, 2007 12:00 PM by peterent

    Exchanging data between two mxml files?

      I've got an MXML application that when you click a button it opens a new window (a different mxml file) that has a tree with some data. What is the right way to send whatever the user selected in the tree back to the original application?
        • 1. Re: Exchanging data between two mxml files?
          peterent Level 2
          The best-practice way is with events. You can either have a public var in your component (with the Tree) ala the Tree's selectedItem or create a custom event which can include the data.

          In the first example, selecting the Tree can either populate a public var (or get function property) or the data can be left in the Tree. Then dispatch a simple event.

          In the second example, a custom event is instantiated, the data from the Tree put into the event, and that event dispatched.