3 Replies Latest reply on Mar 22, 2009 4:39 PM by Newsgroup_User

    Destroying tooltips generates error after 4

    nnmmooppqq Level 1
      I am working on an instruction page for a Flex 3 app. I have a clickable list of navigation tool names; descriptions for each tool appear when the user clicks on the name. I also want to display a tooltip for the navigation tool when the user clicks.

      Code summary (see attached code for details):
      Set variables for the 7 tool tips.
      Call function to destroy any tooltip that exists.
      On listitem click: 1. Call function to distroy any tooltip that exists. 2. Call function to create the approprate tooltip.

      The application works through 3 calls to the destroy function. On the fourth call (3rd listitem click), I get the following error:

      ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
      at flash.display::DisplayObjectContainer/getChildIndex()
      at mx.managers::SystemManager/ http://www.adobe.com/2006/flex/mx/internal::rawChildren_getChildIndex()[C:\autobuild\3.2.0 \frameworks\projects\framework\src\mx\managers\SystemManager.as:2113
      at mx.managers::SystemChildrenList/removeChild()[C:\autobuild\3.2.0\frameworks\projects\fram ework\src\mx\managers\SystemChildrenList.as:132]
      at mx.managers::SystemManager/removeChildFromSandboxRoot()[C:\autobuild\3.2.0\frameworks\pro jects\framework\src\mx\managers\SystemManager.as:4418]
      at mx.managers::ToolTipManagerImpl/destroyToolTip()[C:\autobuild\3.2.0\frameworks\projects\f ramework\src\mx\managers\ToolTipManagerImpl.as:1259]
      at mx.managers::ToolTipManager$/destroyToolTip()[C:\autobuild\3.2.0\frameworks\projects\fram ework\src\mx\managers\ToolTipManager.as:436]

      This error is related to the number of times the destroy function is called, not to which tooltip create function was called or to the order of the listitem clicks.

      Any ideas?
        • 1. Re: Destroying tooltips generates error after 4
          Level 7

          "nnmmooppqq" <webforumsuser@macromedia.com> wrote in message
          news:gq18nl$bep$1@forums.macromedia.com...
          >I am working on an instruction page for a Flex 3 app. I have a clickable
          >list
          > of navigation tool names; descriptions for each tool appear when the user
          > clicks on the name. I also want to display a tooltip for the navigation
          > tool
          > when the user clicks.

          Why don't you just set the toolTip property on the components and let Flex
          handle it, rather than trying to manage it yourself?


          • 2. Re: Destroying tooltips generates error after 4
            nnmmooppqq Level 1
            Thanks for the reply. I can't just let Flex handle it because the exact text and the tool tip to be visible is handled through an XML feed. So I have to read XML and set variables based on that content.

            Again, my problem is that the fourth time the destroyToolTip method is called, I get an error. Any ideas?
            • 3. Re: Destroying tooltips generates error after 4
              Level 7

              "nnmmooppqq" <webforumsuser@macromedia.com> wrote in message
              news:gq6hou$rcr$1@forums.macromedia.com...
              > Thanks for the reply. I can't just let Flex handle it because the exact
              > text
              > and the tool tip to be visible is handled through an XML feed. So I have
              > to
              > read XML and set variables based on that content.

              I don't understand why you think this is incompatible with allowing the
              framework to do what it was designed to do.

              > Again, my problem is that the fourth time the destroyToolTip method is
              > called,
              > I get an error. Any ideas?

              Yes. Tooltips aren't intended to be used this way, so you're probably doing
              something that's running afoul of the way things are supposed to be done and
              everything is exploding in your face.