2 Replies Latest reply: Oct 13, 2009 10:58 AM by Me2LoveIt2 RSS

    Make an object vanish in Flash CS4 (AS3.0)

    Me2LoveIt2 Community Member

      I have a question on how i can remove an object when two objects hit.

       

      I have two objects on the stage overlapping.

      object #1 = character_mc

      object #2 = vanish_mc

       

      I want to make it so that the object #2 (vanish_mc) will vanish once i run it.

       

      I have this code:

       

      this.addEventListener(Event.ENTER_FRAME, vanish);
      function vanish(event:Event):void{
           if(character_mc.hitTestObject(vanish_mc)){
      
                // here the code to remove vanish_mc from the stage
      
           };
      }
      

      ~ Thank you for help and advice ~