1 Reply Latest reply on Mar 14, 2013 8:01 PM by Chris Velevitch

    how to remove an Element that was added from code?

    the.groover82 Level 1


      I have a custom BorderContainer component with 2 labels and 1 image.

      I added an instance of it to my application from code with addElement() and now I cannot make it disappear

      I try:


          for (var i:int=0;i<numElements;i++){

           if (getElementAt(i) is Card){

            if ((getElementAt(i) as Card).name.substr(0,6)=="cMover"){






      It finds it because it gets to removeElementAt(i); but the component remains visible.

      I also tried  removeElement(getElementAt(i)); no luck.

      What am I doing wrong?