# this\["movieclip"+i\].startDrag() + possable to move a movieclip to \_root?

**URL:** <https://forum.kirupa.com/t/this-movieclip-i-startdrag-possable-to-move-a-movieclip-to--root/222465>\
**Category:** Uncategorized\
**Created:** [April 13, 2007, 5:46pm UTC](https://forum.kirupa.com/t/this-movieclip-i-startdrag-possable-to-move-a-movieclip-to--root/222465 "2007-04-13T17:46:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phena](https://avatars.discourse-cdn.com/v4/letter/p/e9bcb4/32.png) [@phena](https://forum.kirupa.com/u/phena)\
**Post date:** [April 13, 2007, 5:46pm UTC](https://forum.kirupa.com/t/this-movieclip-i-startdrag-possable-to-move-a-movieclip-to--root/222465/1 "2007-04-13T17:46:50Z")

</div>

well, the headline says it all 😛

soory if this is a noobish question, just started with flash, but anyhow, here’s the code:

ActionScript Code:  
[FONT=Courier New][LEFT]\</p\>  
\<p\>onClipEventCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]\</p\>  
\<p\> sail\_mc.[COLOR=#0000ff]gotoAndStop[/COLOR]COLOR=#000000[/COLOR];\</p\>  
\<p\> [COLOR=#000000] **var** [/COLOR] i:[COLOR=#0000ff]Number[/COLOR] = [COLOR=#000080]0[/COLOR]\</p\>  
\<p\>[COLOR=#000000]}[/COLOR]\</p\>  
\<p\>onClipEventCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]\</p\>  
\<p\> [COLOR=#0000ff]onPress[/COLOR] = [COLOR=#000000] **function** [/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]\</p\>  
\<p\> [COLOR=#808080]_//copy if “main” movieclip\</p\>_[/COLOR]  
\<p\> [COLOR=#0000ff]if[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]\_name[/COLOR] == [COLOR=#ff0000]“yellowboat\_mc”[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]\</p\>  
\<p\> i++;\</p\>  
\<p\> [COLOR=#0000ff]duplicateMovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]this[/COLOR],[COLOR=#ff0000]“yellowboat\_mc”[/COLOR]+ i,i[COLOR=#000000])[/COLOR]\</p\>  
\<p\> [COLOR=#0000ff]startDrag[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]\_root[/COLOR].[COLOR=#000080]yellowboat\_mc[/COLOR][COLOR=#000000][[/COLOR][COLOR=#ff0000]“yellowboat\_mc”[/COLOR]+ i[COLOR=#000000]][/COLOR],[COLOR=#000000] **true** [/COLOR][COLOR=#000000])[/COLOR]\</p\>  
\<p\> [COLOR=#000000]}[/COLOR]\</p\>  
\<p\> [COLOR=#808080]_//else drag it\</p\>_[/COLOR]  
\<p\> [COLOR=#0000ff]else[/COLOR] [COLOR=#000000]{[/COLOR]\</p\>  
\<p\> [COLOR=#0000ff]startDrag[/COLOR]COLOR=#000000[/COLOR]\</p\>  
\<p\> [COLOR=#000000]}[/COLOR]\</p\>  
\<p\> [COLOR=#000000]}[/COLOR]\</p\>  
\<p\>[COLOR=#000000]}[/COLOR]\</p\>  
\<p\>onClipEventCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]\</p\>  
\<p\> [COLOR=#0000ff]stopDrag[/COLOR]COLOR=#000000[/COLOR]\</p\>  
\<p\>[COLOR=#000000]}[/COLOR]\</p\>  
\<p\>  
[/LEFT]  
[/FONT]

as you probably have guessed, its a main boat, under a draggable menu. When i press this boat I want it to copy itself, and then drag it. If it’s not the main movieclip, simply drag it.

i allso have another problem, as all the copied boats will follow the menu as it is draggable, is it any way to move the copied boats to \_root timeline?

excuse my bad english, and thanks at advance :sailor:

PS:thanks for great site, evrything ive learnd so far, is from here :pleased:
