Skip navigation
Currently Being Moderated

how to remove an Element that was added from code?

Mar 14, 2013 12:15 PM

Tags: #as3 #flex


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?





More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points