# Drag & resize works but removeMovieClip does not follow

**URL:** <https://forum.kirupa.com/t/drag-resize-works-but-removemovieclip-does-not-follow/272012>\
**Category:** Uncategorized\
**Created:** [October 1, 2008, 9:55am UTC](https://forum.kirupa.com/t/drag-resize-works-but-removemovieclip-does-not-follow/272012 "2008-10-01T09:55:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yossarian](https://avatars.discourse-cdn.com/v4/letter/y/9de0a6/32.png) [@yossarian](https://forum.kirupa.com/u/yossarian)\
**Post date:** [October 1, 2008, 9:55am UTC](https://forum.kirupa.com/t/drag-resize-works-but-removemovieclip-does-not-follow/272012/1 "2008-10-01T09:55:18Z")

</div>

Hi,

I have a MC which contains three elements: drag\_mc, a button which removesMovieClip and test\_mc (resizes the whole MC) which also hosts a button called resizeBtn.

This is the code I’m using which will resize the clip, make it draggable and remove it. Problem is that the remove\_btn either doesn’t remove the whole clip or doesn’t ‘move’ with the rest of the clip. Hope that makes sense?

**test\_mc code** :

```
ActionScript Code:
[LEFT][COLOR=#0000FF]onClipEvent[/COLOR] [COLOR=#000000]([/COLOR]enterFrame[COLOR=#000000])[/COLOR]

```

[COLOR=#000000]{[/COLOR]  
[COLOR=#0000FF]if[/COLOR] [COLOR=#000000]([/COLOR]pressing == [COLOR=#000000] **true** [/COLOR][COLOR=#000000])[/COLOR]  
[COLOR=#000000]{[/COLOR]  
[COLOR=#0000FF]\_parent[/COLOR].[COLOR=#000080]textbox[/COLOR].[COLOR=#0000FF]\_width[/COLOR] = [COLOR=#0000FF]\_x[/COLOR] + [COLOR=#000080]22[/COLOR];  
[COLOR=#0000FF]\_parent[/COLOR].[COLOR=#000080]textbox[/COLOR].[COLOR=#0000FF]\_height[/COLOR] = [COLOR=#0000FF]\_y[/COLOR] + [COLOR=#000080]22[/COLOR];  
[COLOR=#0000FF]\_parent[/COLOR].[COLOR=#000080]drag\_mc[/COLOR].[COLOR=#0000FF]\_y[/COLOR] = [COLOR=#0000FF]\_y[/COLOR] + [COLOR=#000080]25[/COLOR];  
[COLOR=#0000FF]\_parent[/COLOR].[COLOR=#000080]remove\_btn[/COLOR].[COLOR=#0000FF]\_x[/COLOR] = [COLOR=#0000FF]\_x[/COLOR] + [COLOR=#000080]22[/COLOR];  
[COLOR=#0000FF]\_parent[/COLOR].[COLOR=#000080]drag\_mc[/COLOR].[COLOR=#0000FF]\_x[/COLOR] = [COLOR=#0000FF]\_parent[/COLOR].[COLOR=#000080]textbox[/COLOR].[COLOR=#0000FF]\_width[/COLOR] / [COLOR=#000080]2[/COLOR];

```
               [COLOR=#000000]}[/COLOR] [COLOR=#808080]*// end if*[/COLOR]
[COLOR=#0000FF]if[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#0000FF]_parent[/COLOR].[COLOR=#000080]dragging[/COLOR] == [COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR]
[COLOR=#000000]{[/COLOR]
   
[COLOR=#000000]}[/COLOR] [COLOR=#808080]*// end if*[/COLOR]

```

[COLOR=#000000]}[/COLOR]  
[/LEFT]

i **nside test\_mc is a resizeBtn:**

```
ActionScript Code:
[LEFT][COLOR=#0000FF]on[/COLOR] [COLOR=#000000]([/COLOR]press[COLOR=#000000])[/COLOR]

```

[COLOR=#000000]{[/COLOR]  
pressing = [COLOR=#000000] **true** [/COLOR];  
[COLOR=#0000FF]startDrag[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]this[/COLOR], [COLOR=#000000] **false** [/COLOR], [COLOR=#000080]130[/COLOR], [COLOR=#000080]35[/COLOR], [COLOR=#000080]9999[/COLOR], [COLOR=#000080]9999[/COLOR][COLOR=#000000])[/COLOR];  
[COLOR=#000000]}[/COLOR]  
[COLOR=#0000FF]on[/COLOR] [COLOR=#000000]([/COLOR]release, releaseOutside[COLOR=#000000])[/COLOR]  
[COLOR=#000000]{[/COLOR]  
pressing = [COLOR=#000000] **false** [/COLOR];  
[COLOR=#0000FF]stopDrag[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#000000]}[/COLOR]  
[/LEFT]

**remove\_btn uses this code:**

```
ActionScript Code:
[LEFT][COLOR=#0000FF]on[/COLOR] [COLOR=#000000]([/COLOR]press[COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]removeMovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];

```

[COLOR=#000000]}[/COLOR]  
[/LEFT]

Thank you.
