removeMovieClip stupid problem

Hello again kirupians. I never thought a day like this would come for me. I mean… asking for help removingMovieClip form stage. You think this is easy???

SO. I have a piece of code… that worked for a while. I’m creating MC’s through attachMovie command from library and I have a function that when it’s called was supposed to remove all the MC that had the name starting with “lc”.


function hideLoadButtons() {
 trace("Hiding all buttons !!!");
 //ready2load = false;//this is not important
 for (var x in _root) {
  if (_root[x]._name.substr(0, 2) == "lc") {
  _root[x]._alpha = 30;
   removeMovieClip(_root[x]);
  }
 }
}

Of course I replicated the problem in a new file… creating dozens of mc with script and then removing either using the removeMovieClip as a method, either as a function… i mean…
removeMovieClip(mc_to_remove);
or
mc_to_remove.removeMovieClip(); Both Worked just fine.
Furthermore… you could think that in the above function there could be something wrong with the names / paths??? BUT… it’s really not… because when the function it’s called, all the mc’s turn to 30% alpha. This is driving me nuts…

So… I beg you… if anyone has encountered this before, please respond here. Any ideea would be much appreciated :(.
What could prevent the movieClip from beeing removed off the stage??? :((

Grrrrrr!!! Was having the exact same problem!! Thanks for your post from long ago!! :slight_smile: