Movieclip code help please

[font=Arial]Hi all.

Have been helped out and given some code to do something beyond my knowledge as I’m still very much a novice, the code is great but doesn’t do exactly what I want…

I would like to use duplicatemovie (command) to make a copy of a moviesymbol when the viewer clicks on the symbol, - that’s easy, the complication is that I want the properties for the orignial and the clone to be different.
ORIGINAL: Duplicate onto stage / Draggable if necessary

CLONE: Draggable / NOT duplicatable / Deletable when viewer clicks on symbol and hits DEL key.

I have been given (very kindly) the following code:

on (press) {
this.duplicateMovieClip(“cir”+_global.i, _global.i);
on (release, releaseOutside) {

This seems to be on the right lines, except it is the original that loses the ability to duplicate instead of the clone (which still duplicates when clicked), + the DEL option does not appear to work

I have been entering the code onto the actual object and not the frame which I believe is correct, should certain symbol be Instance-Named anything in particular?

I really need to get this wrapped up and greatly appreciate all the help I’ve had so far from everybody, can any spot what would need changing in the code to achieve my goal?

Thanks so much, any help would be severely worshipped.


Hi :slight_smile:

If you don’t mind, I’m going to try to rewrite that code using dynamic event handlers, they’re much more practical as you’ll see:

clipCounter = 0 ;

// Function called when you press the original clip
function duplicateMe () {
clipCounter ++ ;
var dup = this.duplicateMovieClip ("c" + clipCounter, clipCounter) ;
dup.onPress = dragMe ;
dup.onRelease = dup.onReleaseOutside = stopDrag ;
} ;

// Function called when you press the clone
function dragMe () {
this.startDrag (true) ;
Key.addListener (this) ;
this.onKeyDown = function () {
if (Key.isDown (Key.DELETE) this.removeMovieClip () ;
} ;
} ;

Function called when you release the clone
function stopDrag () {
this.stopDrag () ;
delete this.onKeyDown ;
} ;

// You'll have to call the original: originalClip
originalClip.onPress = duplicateMe ;

This should work a little bit better :mu:

Stupid as tag still doesn’t work, sorry about that…

Please don’t crosspost, especially if you’re going to post twice in the same forum.

ppl will do anything to get help :frowning: BUT read the rules… :slight_smile: