# removeMovieClip() and delete x;! NOT WORKING?!

**URL:** <https://forum.kirupa.com/t/removemovieclip-and-delete-x-not-working/182460>\
**Category:** flash\
**Created:** [March 18, 2006, 2:44pm UTC](https://forum.kirupa.com/t/removemovieclip-and-delete-x-not-working/182460 "2006-03-18T14:44:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RiderX](https://avatars.discourse-cdn.com/v4/letter/r/db5fbb/32.png) [@RiderX](https://forum.kirupa.com/u/RiderX)\
**Post date:** [March 18, 2006, 2:44pm UTC](https://forum.kirupa.com/t/removemovieclip-and-delete-x-not-working/182460/1 "2006-03-18T14:44:26Z")

</div>

I have already foud out where I want to place my sprites in my game, and I don’t want to have to go through th elengthy “duplicateMoveClip” procdure (or it seems to be lengthy to me anyways, it’s probably like 2 lines of code, but still, I WANNA DO IT MY WAY!) ok, anyways, does delete only work on variables and not movie clips?

here’s what I have so far

this is in the bullet movie clip:

```auto
onClipEvent ( enterFrame){
if (Key.isDown (Key.SPACE)){
this._x=_root.circle._x;
this._y=_root.circle._y;
}
then
{this._x-=20;}
if (_root.bullet.hitTest(_root.enemya)){
 _root.enemya.removeMovieClip();
 }
 if (_root.bullet.hitTest(_root.enemyb)){
 delete this;
 }
 if (_root.bullet.hitTest(_root.enemyc)){
 _root.enemyc.removeMovieClip();
 }
 if (_root.bullet.hitTest(_root.enemy1)){
 _root.enemy1.removeMovieClip( );
 }
 if (_root.bullet.hitTest(_root.enemy2)){
 _root.enemy2.removeMovieClip( );
 }
 if (_root.bullet.hitTest(_root.enemy3)){
 _root.enemy.removeMovieClip( );
 }}

```

enemy b is the closest enemy to the “hero” so I experiment with him usually before I apply any code to the entire thing.

So my question to you guys is, how do I delete a movie clip in a movie via actionscript?
