Drag'n'drop bring to front doesn't work (couldn't find a solution anywhere)

Sorry to start this topic again but i couldn’t find a solution for my prob anywhere in the forum or the tut-pages.

i want to achieve what kirupa explaines in his swap depth tutorial, i want the visitor to drag different objects + the one selected comes to the front.

i did everything explained in the tutorial, but there is one difference: i don’t want the draggable area to be the whole MC wide, that’s why i placed a button into a MC. this button should have the dragging actions and drag the whole clip.
so far it works, but the MC wouldn’t be brought to front, although i typed the correct path:


on (press, release, dragOver, dragOut) {
    _root.x += 2;
    _root.txt2.swapDepths(_root.x);
}
on (press) {
    startDrag(this, false, -448, -170, -66, 310);
}
on (release) {
    stopDrag();
}

this sounds all pretty complicated, you’ll probably get my point when seeing the actual swf

thanks in advance for any suggestions

Yes, I can see the problem, but it would be better if you could give us a link to the FLA… :wink:

However, I think you don’t need to increment a variable everytime you click on a MovieClip. You could simply set a depth level, say 100, and use this code:
[AS]on (press) {
this.swapDepths(100);
startDrag(this, false, -448, -170, -66, 310);
}
on (release) {
stopDrag();
}[/AS]

this wouldn’t help either,
try the fla if you like then :slight_smile:

Ok.

You forgot to give an instance name to the MovieClips! :stuck_out_tongue:
[AS]on (press) {
_parent.swapDepths(100);
startDrag(this, false, -448, -170, -66, 310);
}
on (release) {
stopDrag();
}[/AS]
That would do though.