7 Replies Latest reply on Oct 18, 2009 8:17 AM by robdillon

    Problem removing Objects from the stage in Flash CS4 (AS3.0)

    Me2LoveIt2 Level 1

      I have a problem with this code:

       

      this.addEventListener(Event.ENTER_FRAME, vanish);
      function vanish(event:Event):void{
           if(character_mc.hitTestObject(vanish_mc)){
                vanish_mc.parent.removeChild(vanish_mc);
           };
      }
      
      There are two overlapping objects on my stage: character_mc and vanish_mc.
      As soon as i start the scene[Ctrl+Enter] vanish_mc is VISUALLY removed. But the code still sees a collision somehow. How can i Entirely remove the object vanish_mc?
      Thank you for help and advice.