# Switching parents

**URL:** <https://forum.kirupa.com/t/switching-parents/228683>\
**Category:** flash\
**Created:** [June 10, 2007, 2:18pm UTC](https://forum.kirupa.com/t/switching-parents/228683 "2007-06-10T14:18:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![golden14](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@golden14](https://forum.kirupa.com/u/golden14)\
**Post date:** [June 10, 2007, 2:18pm UTC](https://forum.kirupa.com/t/switching-parents/228683/1 "2007-06-10T14:18:14Z")

</div>

Hello,

I’m used to working in 3D, so I’m not quite sure how to do something like this in Flash. Say I have three mc’s - 2 squares (A and B) and 1 circle. At first the circle is a child of square A, so if I drag square A, the circle will follow. But then say I click a button, and I want the circle to become a child of square B, so that I can drag B and have the circle follow that one.

How exactly would you switch what the parent mc is? I know that I could probably use something like: ActionScript Code:  
[FONT=Courier New][LEFT]squareA.[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR]circle, circle\_mc, [COLOR=#000080]10[/COLOR][COLOR=#000000])[/COLOR]  
[/LEFT]  
[/FONT]

to parent the circle to square A to begin with. But then I want to take the current circle (not create a new one) and attach it to square B. And be able to switch back and forth as necessary.

Any ideas? Thanks!
