# Problems using create & attachMovie

**URL:** <https://forum.kirupa.com/t/problems-using-create-attachmovie/243941>\
**Category:** flash\
**Created:** [November 12, 2007, 7:55pm UTC](https://forum.kirupa.com/t/problems-using-create-attachmovie/243941 "2007-11-12T19:55:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ubermeowmix](https://avatars.discourse-cdn.com/v4/letter/u/7cd45c/32.png) [@Ubermeowmix](https://forum.kirupa.com/u/Ubermeowmix)\
**Post date:** [November 12, 2007, 7:55pm UTC](https://forum.kirupa.com/t/problems-using-create-attachmovie/243941/1 "2007-11-12T19:55:55Z")

</div>

ok step by step:

I need to create an empty movie, load another movie into it and keep this process going until there are 5 instances then unload the first.

This works fine in \_root. but as soon as I start navigating inside MC’s they replace the last one loaded! Maybe i’m not understanding how the createMC and attachMC work, but it’s confusing me? Code follows:

button\_mc.onPress = function(){  
if (i\>=4){  
var deleteHolder:Number = i-4;  
unloadMovie(‘holder\_mc’+deleteHolder);  
}  
i++;  
dragMe\_mc.dragMe\_hit.createEmptyMovieClip(‘empty’, this.getNextHighestDepth());  
dragMe\_mc.dragMe\_hit.empty.createEmptyMovieClip(‘holder\_mc’+i, this.getNextHighestDepth());  
dragMe\_mc.dragMe\_hit.empty[‘holder\_mc’+i].attachMovie(‘anim\_mc’, ‘movie’, this.getNextHighestDepth());  
dragMe\_mc.dragMe\_hit.empty[‘holder\_mc’+i].movie.\_x= i\*30;  
//\_root[‘holder\_mc’+i].movie.\_xscale = 55.6;  
//\_root[‘holder\_mc’+i].movie.\_yscale = 55.6;  
dragMe\_mc.dragMe\_hit.empty[‘holder\_mc’+i].movie.text\_mc.text = 'This is Movie Clip Number: '+i;  
dragMe\_mc.dragMe\_hit.empty[‘holder\_mc’+i].movie.frame.gotoAndPlay(1);  
}
