2 Replies Latest reply on Jun 5, 2007 7:01 AM by sandersky

    Mxml Component Help

      I am createing an app that has a mxml component with a menubar in it. For itemClick in the menubar i want to call a function that is in my main mxml file but cant get it to work. Is this possible and if so what is the solution.
        • 1. Re: Mxml Component Help
          BLXWebMaster Level 1
          The proper way is to use events. You will need to read up on them as they are a little too complex to detail for you.

          However there are two quick wasy to call a function outside your current component. Basically you can "dot" your way up the application till y ou get to the main.xm by using the parentDocument.

          So, in your component use parentDocument.FunctionName();

          You can also directly access your application.mxml by using mx.core.Application.application.FunctionName();

          • 2. Re: Mxml Component Help
            sandersky Level 1
            Thanks for the help the parentDocument looks like the exact thing I have been searching for. Oh and by the way I have used events (still a noob though).