Problem with dynamic movie dragging

Hi,
I am trying to drag my dynamic moviclips. But this code does not work properly.
I have to mosue click the movie clip, and once again use mousepress to drag the movie clip.
Is there an way o eliminate the two clicks? Thanking you in advance.
Here is the code.

clickAction = function (_arg2) {
//info._y += 150;
trace(“click”+_arg2); // _arg2 contains name of dynamic movieclip

_arg2.onPress = function (){
trace(“on press”+_arg2);
_arg2.startDrag();
// further code
}

_arg2.onRelease = function (){
_arg2.stopDrag();
// further code
}
}

//code for creating dynamic movieclip

for (i=0; i < xmlnodecount; i++) {

_root.content_mc.image_mc.duplicateMovieClip(“image_mc”+i, i);

_root.content_mc["image_mc" + i]._x = imageWidth * xinc; ;
_root.content_mc["image_mc"+i]._y = yinc;
loadMovie(image*,_root..content_mc["image_mc"+i].holder);

}

what was that click action? you dont need it!
[AS]

//code for creating dynamic movieclip

for (i=0; i < xmlnodecount; i++) {

var MC:MovieCLip = _root.content_mc.image_mc.duplicateMovieClip(“imag e_mc”+i, i);

MC._x = imageWidth * xinc; ;
MC._y = yinc;
loadMovie(image*,MC.holder);
MC.onPress = function (){
trace(“on press”+_arg2);
this.startDrag();
// further code
}

MC.onRelease = function (){
this.stopDrag();
// further code
}

}

[/AS]

is this what you were looking for?
now you can click all the mcs…

Thank you for the immediate reply. My problem is solved with the above code.

i’m glad i was usefull!

good work :wink: