Success! But one last question: On Key DEL

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();
}
}

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

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

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.

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.


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

then adjust your old code to this:


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…