duplicateMovieClip inside of movie clips?

Heya, im having some issues getting the duplicateMovieClip function work correctly. Im trying to create a drag and drop of a duplicate movie clip, so the clip stays in place but also drags as a duplicate clip.

The issue here is, if i use this code:

on (press) {
this.duplicateMovieClip(“circle1”, 1);
_root.circle1.startDrag();
}

It works perfectly. The movie duplicates and the duplicate drags.
My issue is, im trying to do this within its own movie clip, and it seems when I try using duplicatemovie clip inside of a movie clip the whole thing just breaks. Is there something im not doing right here or do duplicate clips just not work within other movie clips?

could u post your fla?

For example:

  
for (i=0, i<100, i++) {
	duplicateMovieClip (_root.movieClip1.ballClip, "ballClip"+i, i)
}

get it?

wait…i think i see what’s wrong:


on (press) {
	this.duplicateMovieClip("circle1", 1);
	_root.circle1.startDrag();
} 

shouldn’t it be:

 
on (press) {
	this.duplicateMovieClip("circle1", 1);
	this.circle1.startDrag(); 
	//this or _root.movieClip.circle1.startDrag();
	//The reason is that your circle is in a movieclip and
	//not on the main timeline
} 

i think (-:

if you’re duplicating “this” then to reference it, you would need

this._parent[“dup_name”]; since the duplicated clip exists (and always will) in the same scope of the clip duplicated. this exists in its _parent, so its duplication will too,

I can work with _parent but i can’t understand it:smirk:

I’m a 14 yr old kid with a brain of a 5 yr old one :frowning:

:stuck_out_tongue: