1 Reply Latest reply on Oct 28, 2006 5:00 AM by dave cragg

    component scoping?

      How do I reference the scope of the parent component / application in script.

      i.e. I have a main.mxml page, with a component <test:myCustomComponent> - inside that component, I want to call a function in the root application

      I know there is a way to access the root scope of the application, would like to know this syntax.
      Also would like to know the way to access the parent component (if not the root for example).

      I realize that ideally that you want a loosely coupled application that doesn't have the direct tie backwards, but in some cases it is appropriate. Also found in my flex 1.5 days, binding CAN be slow and some times unpredictable.

      Thanks for the help!
        • 1. Re: component scoping?
          dave cragg Level 2
          There are parentDocument for the next container up the chain, and parentApplication for the application root. Will these do?

          I share your concerns about having backwards ties. I've tried dispatching custom events as a way to communicate with parent objects, and make the ties less rigid. I'd be interested to know of people's thoughts on this.