1 Reply Latest reply on Jan 21, 2009 12:44 PM by Newsgroup_User

    Removing Object

      Hi all

      Can someone please help me before I tear my head off.
      I have been trying for hours now to remove a component from my application via as3 without success.
      I have a Custom Canvas Component with a VideoDisplay object inside it that I have created, which is dynamically added to the stage. Everytime I re-add that component to the stage the video gets slower and slower as if it is just creating multiple versions.
      I have used removeChild() which successfully removes the object from the stage because it disappears, but due to the lag I am suspecting it is still in memory and is uses resources.

      Please can someone explain a good solution to removing objects from an application.

      Many thanks in advance
        • 1. Re: Removing Object
          Level 7

          "gamedesign1000" <webforumsuser@macromedia.com> wrote in message
          news:gl7vhv$hvr$1@forums.macromedia.com...
          > Hi all
          >
          > Can someone please help me before I tear my head off.
          > I have been trying for hours now to remove a component from my application
          > via
          > as3 without success.
          > I have a Custom Canvas Component with a VideoDisplay object inside it that
          > I
          > have created, which is dynamically added to the stage. Everytime I re-add
          > that
          > component to the stage the video gets slower and slower as if it is just
          > creating multiple versions.
          > I have used removeChild() which successfully removes the object from the
          > stage
          > because it disappears, but due to the lag I am suspecting it is still in
          > memory
          > and is uses resources.
          >
          > Please can someone explain a good solution to removing objects from an
          > application.

          Do you have any event listeners on it or variables that reference it? If
          so, it can't be garbage collected.

          HTH;

          Amy