# Why is a new movieClip not being created?

**URL:** <https://forum.kirupa.com/t/why-is-a-new-movieclip-not-being-created/199694>\
**Category:** flash\
**Created:** [September 5, 2006, 9:53am UTC](https://forum.kirupa.com/t/why-is-a-new-movieclip-not-being-created/199694 "2006-09-05T09:53:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![schmichael](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@schmichael](https://forum.kirupa.com/u/schmichael)\
**Post date:** [September 5, 2006, 9:53am UTC](https://forum.kirupa.com/t/why-is-a-new-movieclip-not-being-created/199694/1 "2006-09-05T09:53:17Z")

</div>

Hey there, this should be a pretty simple one. I am trying to dynamically generate a movie clip, attach a movie clip from the library and then animate a tween but for some reason, even though the name is being generated dynamically to be different every time and each new MC is put on a different depth, **the first movie clip disappears once a new one is generated.**  
if someone could help me figure this out I would be very grateful!  
Here’s my code:

```
 ActionScript Code:
 [FONT=Courier New][LEFT][COLOR=#000000] **function** [/COLOR] moveBall[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]createEmptyMovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]"ball"[/COLOR]+counter, [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]getNextHighestDepth[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#0000ff]_root[/COLOR][COLOR=#000000][[/COLOR][COLOR=#ff0000]"ball"[/COLOR]+counter[COLOR=#000000]][/COLOR].[COLOR=#0000ff]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]"ball"[/COLOR], [COLOR=#ff0000]"ball"[/COLOR]+counter, [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]getNextHighestDepth[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000] **var** [/COLOR] myTween:Tween = [COLOR=#000000] **new** [/COLOR] Tween[COLOR=#000000]([/COLOR][COLOR=#0000ff]_root[/COLOR][COLOR=#000000][[/COLOR][COLOR=#ff0000]"ball"[/COLOR]+counter[COLOR=#000000]][/COLOR], [COLOR=#ff0000]"_x"[/COLOR], None.[COLOR=#000080]easeNone[/COLOR], ballStartX, ballDestX, [COLOR=#000080]1[/COLOR], [COLOR=#000000] **true** [/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000] **var** [/COLOR] myTween:Tween = [COLOR=#000000] **new** [/COLOR] Tween[COLOR=#000000]([/COLOR][COLOR=#0000ff]_root[/COLOR][COLOR=#000000][[/COLOR][COLOR=#ff0000]"ball"[/COLOR]+counter[COLOR=#000000]][/COLOR], [COLOR=#ff0000]"_y"[/COLOR], None.[COLOR=#000080]easeNone[/COLOR], ballStartY, ballDestY, [COLOR=#000080]1[/COLOR], [COLOR=#000000] **true** [/COLOR][COLOR=#000000])[/COLOR];
counter++

```

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

Schm 🙂
