# Success! But one last question: On Key DEL

**URL:** https://forum.kirupa.com/t/success-but-one-last-question-on-key-del/118522
**Category:** Uncategorized
**Created:** [August 6, 2004, 8:16am UTC](https://forum.kirupa.com/t/success-but-one-last-question-on-key-del/118522 "2004-08-06T08:16:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![flufilms](https://avatars.discourse-cdn.com/v4/letter/f/e56c9b/32.png) [@flufilms](https://forum.kirupa.com/u/flufilms)
#### Post date: [August 6, 2004, 8:16am UTC](https://forum.kirupa.com/t/success-but-one-last-question-on-key-del/118522/1 "2004-08-06T08:16:16Z")

</div>

Thanks to everybody who helped me wrap the below code up, it qorks prefectly to duplicate a movie-symbol with alternate properites, thankyou thankyou thankyou.

I have tried without success to add one last line of code to the script, I would like the option to delete the Duplicate (never the master) by clicking once on the symbol and hitting the DEL key, it’s seems pretty simple but it just won’t work for me? Could anyone add the necessary scripting for me? Pretty please?

Thanks so much to eveyrone here, God bless us, God bless us all…

onClipEvent (enterframe){  
this.onPress = function(){  
if(this.\_name == “myClip”){  
counter++;  
this.duplicateMovieClip(“myClip” + counter, counter);  
}else{  
this.startDrag();  
}  
}  
this.onRelease = function(){  
stopDrag();  
}  
}

---

<div class="post-metadata">

### Author: ![pom](https://avatars.discourse-cdn.com/v4/letter/p/f07891/32.png) [@pom](https://forum.kirupa.com/u/pom)
#### Post date: [August 6, 2004, 9:42am UTC](https://forum.kirupa.com/t/success-but-one-last-question-on-key-del/118522/2 "2004-08-06T09:42:37Z")

</div>

Did you try the code I wrote a few days ago?

And also: please stop creating new threads with the same question.

---

<div class="post-metadata">

### Author: ![flufilms](https://avatars.discourse-cdn.com/v4/letter/f/e56c9b/32.png) [@flufilms](https://forum.kirupa.com/u/flufilms)
#### Post date: [August 6, 2004, 9:58am UTC](https://forum.kirupa.com/t/success-but-one-last-question-on-key-del/118522/3 "2004-08-06T09:58:54Z")

</div>

Yes I did, thank you but there were several code errors which unfortunately I don’t have the knowledge to correct. Also techically this is a different question I’m 90% of the way there now, all I need is the DEL feature and I’m done.

---

<div class="post-metadata">

### Author: ![2nd\_day](https://avatars.discourse-cdn.com/v4/letter/2/a4c791/32.png) [@2nd\_day](https://forum.kirupa.com/u/2nd_day)
#### Post date: [August 6, 2004, 9:48pm UTC](https://forum.kirupa.com/t/success-but-one-last-question-on-key-del/118522/4 "2004-08-06T21:48:57Z")

</div>

well… my coding isnt that good… but maybe this will help you a bit furder…  
try this code in your frame where the movieclips are.

```auto

onClipEvent(keyDown) {
if (Key.getCode() == Key.DELETEKEY) {
removeMovieClip(_root["myClip" + _root.counter])
} else 
}

```

then adjust your old code to this:

```auto

onClipEvent (enterframe){
this.onPress = function(){
if(this._name == "myClip"){
_root.counter++;
this.duplicateMovieClip("myClip" + _root.counter, _root.counter);
}else{
this.startDrag();
}
}
this.onRelease = function(){
stopDrag();
}
}

```

i havent tried this… but maybe it will work…
