2 Replies Latest reply on Jun 20, 2006 12:44 AM by Marek_FlashUser

    Array still referrencing after removeMovieClip()

    Marek_FlashUser
      I have code right now that attaches movie clips to the stage and pushes a referrence to them in an array. Cycling through the array reads off their absolute paths from _root/_level0. These movie clips are later removed and the array still contains the same amount of elements but prints ... doesn't print that its elements are null or undefined... just and thats it. Blank lines. I figured that the out of date referrences would at least be null so code like:
      if (my_array(i) == null)
      {
      my_array.splice(i);
      };
      would work, but it doesn't. Nor does the comparison if(my_array == ""). Is there any comparison operation I can perform to easily clean out the array so I don't keep adding elements and ending up with empty ones? I want to avoid something like:
      var store:Number = my_array.push(referrence_mc);
      ...
      removeMovieClip(referrence_mc);
      my_array.splice(store);

      and then have to decrement the value of store for every element above the current value of 'store'. Any suggestions or do I need to take this approach? Thanks and sorry for the long message.

      EDIT: Also sorry for the confusion on the brackets after my_array. Brackets aren't displayed so i replaced them with paranthesis.