# Can anybody solve this

**URL:** <https://forum.kirupa.com/t/can-anybody-solve-this/215487>\
**Category:** Uncategorized\
**Created:** [February 7, 2007, 5:45pm UTC](https://forum.kirupa.com/t/can-anybody-solve-this/215487 "2007-02-07T17:45:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jorawar](https://avatars.discourse-cdn.com/v4/letter/j/8edcca/32.png) [@jorawar](https://forum.kirupa.com/u/jorawar)\
**Post date:** [February 7, 2007, 5:45pm UTC](https://forum.kirupa.com/t/can-anybody-solve-this/215487/1 "2007-02-07T17:45:41Z")

</div>

:pac: :-/ :wasted: :puzzled: :ne: hi every body…  
i make a box on the stage. i just want that, when i press on that box, a duplicate box creates and it is dragable. , so i want to drag duplicate movie clip. when i drag the one, two is created, i drag two three is created…  
but i couldn’t do this by me… i tried a lot… but now here is my code… plz help me…

**[COLOR=black][FONT=‘Courier New’]var[/FONT][/COLOR]**[COLOR=black][FONT=‘Courier New’] mySelection = [/FONT][/COLOR][COLOR=red][FONT=‘Courier New’]""[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’];  
**var** totalmc = [/FONT][/COLOR][COLOR=navy][FONT=‘Courier New’]0[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’];  
**var** depth = [/FONT][/COLOR][COLOR=navy][FONT=‘Courier New’]40[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’];  
[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]MovieClip[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’].[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]prototype[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’].[/FONT][/COLOR][COLOR=navy][FONT=‘Courier New’]dragging[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’] = **function** () {  
[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]this[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’].[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]\_x[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’] = [/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]\_xmouse[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’];  
[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]this[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’].[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]\_y[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’] = [/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]\_ymouse[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’];  
[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]this[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’].[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]startDrag[/FONT][/COLOR][COLOR=black]FONT=‘Courier New’;  
mySelection = [/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]this[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’];  
[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]this[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’].[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]onMouseUp[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’] = **function** () {  
[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]this[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’].[/FONT][/COLOR][COLOR=navy][FONT=‘Courier New’]duplicate[/FONT][/COLOR][COLOR=black]FONT=‘Courier New’;  
[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]stopDrag[/FONT][/COLOR][COLOR=black]FONT=‘Courier New’;  
};  
};  
[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]MovieClip[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’].[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]prototype[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’].[/FONT][/COLOR][COLOR=navy][FONT=‘Courier New’]duplicate[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’] = **function** () {  
mc2 = [/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]this[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’].[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]duplicateMovieClip[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’]([/FONT][/COLOR][COLOR=red][FONT=‘Courier New’]“mc”[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’]+i++, [/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]\_root[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’].[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]getNextHighestDepth[/FONT][/COLOR][COLOR=black]FONT=‘Courier New’);  
mc2.[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]\_x[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’] = [/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]\_xmouse[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’];  
mc2.[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]\_y[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’] = [/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]\_ymouse[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’];  
};  
**function** Press() {  
mc = [/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]attachMovie[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’]([/FONT][/COLOR][COLOR=red][FONT=‘Courier New’]“idwire”[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’], [/FONT][/COLOR][COLOR=red][FONT=‘Courier New’]“wire”[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’]+totalmc++, [/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]this[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’].[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]getNextHighestDepth[/FONT][/COLOR][COLOR=black]FONT=‘Courier New’);  
mc.[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]onPress[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’] = Press;  
mc.[/FONT][/COLOR][COLOR=navy][FONT=‘Courier New’]dragging[/FONT][/COLOR][COLOR=black]FONT=‘Courier New’;  
}  
wire.[/FONT][/COLOR][COLOR=blue][FONT=‘Courier New’]onPress[/FONT][/COLOR][COLOR=black][FONT=‘Courier New’] = Press;[/FONT][/COLOR]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
