2 Replies Latest reply on Apr 14, 2009 11:57 PM by kglad

    my boobytrap exploding MC is looping?

    shintashi Level 1

      I've got a collision detection explosion scene, (robot collides with red.cap the red mc begins playing explosion, and doing damage, etc.) the explosion works fine, (i set the red.cap instead of red to remove movieclip so the explosion would appear after the damage was inflicted to prevent the damage from looping during each frame of the explosion scene) but the explosive "rematerializes" by looping back to its normal state. When the robot leaves, the exploding loop doesn't continue, the damage stays constant, but colliding with the ressurected explosive inflicts the same damage it did the first time.


      I'm beginning to wonder what I'm failing to do to delete the movie clip after it blows up, around frame 11+.


      I tried "this.removeMovieClip();" in frame 11's actionscript line, but I don't know if it's misplaced or if there's some other way of saying 'when red gets to frame 11, it gets deleted from the stage"

        • 1. Re: my boobytrap exploding MC is looping?
          shintashi Level 1

          I created a workaround, while it works, it isn't the actual solution.



          inside main timeline:

          switch13 = 0;


          inside onEnterFrame:

          if(robot_mc.sensorG_mc.hitTest(red.cap)){damage = damage +90; cooldown = 0; robot_mc.hp_mc.hpslider_mc._x -= 90; red.gotoAndPlay("frame2"); }
          if(switch13 == 1){red.swapDepths(robot_mc.getNextHighestDepth()); red.removeMovieClip();}





          inside frame 13 of the explosive:


          onEnterFrame = function(){
          _root.switch13 = _root.switch13 + 1;

          • 2. Re: my boobytrap exploding MC is looping?
            kglad Adobe Community Professional & MVP

            this.removeMovieClip() will work IF your movieclip is at a removable depth.  if it's not being removed, use swapDepths() to move it to a removable depth before executing removeMovieClip();  :