3 Replies Latest reply on Jan 13, 2010 4:29 AM by Francisc

    Reference Parent Public Vars/Methods

    Francisc Level 3

      Hello!

       

      How can I reference a TitleWindow's parent's public variables or functions?

      The TitleWindow is opened as a Window using the PopUpManager Class.

       

      Thank you!

        • 1. Re: Reference Parent Public Vars/Methods
          RUSH-ME Level 3

          Hi

          There is a parent property available for TitleWindow.

           

          By typecasting it to your parent class you can call public functions.

           

          Hope this helps

           

          Rush-me

          • 2. Re: Reference Parent Public Vars/Methods
            archemedia Level 4

            Or, you could reference the TitleWindow in some variable prior to opening it in the PopupManager:

             

            In your main app:

             

            public var tw:TitleWindow;

             

            Somewhere inside your app:

             

            this.parentApplication.tw = PopUpManager.createPopUp(this, TitleWindow) as TitleWindow;

            PopUpManager.centerPopUp(this.parentApplication.tw);

             

            now you can address all the public properties of the window using the reference 'tw'.

             

            TIP: If you have to hold global variables for use in your application, you'd better create a singleton Class with all these variables.

            From anywhere in your application, you can then call MyGlobalClass.getInstance().myVar.

             

            If you don't know what I'm talking about, let me know so I can post an example

             

             

            d

            1 person found this helpful
            • 3. Re: Reference Parent Public Vars/Methods
              Francisc Level 3

              Thank you both.

               

              I've used the less-code method Rush-Me posted, only using Application.application.myVar etc.