# Trying to loop a movie clip with different dynamic text values

**URL:** <https://forum.kirupa.com/t/trying-to-loop-a-movie-clip-with-different-dynamic-text-values/170709>\
**Category:** Uncategorized\
**Created:** [November 29, 2005, 1:20am UTC](https://forum.kirupa.com/t/trying-to-loop-a-movie-clip-with-different-dynamic-text-values/170709 "2005-11-29T01:20:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chigirl](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@chigirl](https://forum.kirupa.com/u/chigirl)\
**Post date:** [November 29, 2005, 1:20am UTC](https://forum.kirupa.com/t/trying-to-loop-a-movie-clip-with-different-dynamic-text-values/170709/1 "2005-11-29T01:20:23Z")

</div>

Hi there,  
Hope someone out there can help! I’m fairly new to actionscripting, though I can program in Javascript, ASP and PHP pretty well. I’m having some trouble with this basic task and it’s a roadblock for me!

I have an empty movie clip that I load as a “container.” What I want to do is loop through an array that has some text values, and each time I want to do 3 things:

1. load a generic movie clip from my library (which has a dynamic text field) into the empty movie clip container
2. assign the text value to the dynamic text field
3. remove the generic movie clip

here is the code I have:

name\_text\_array = [“First Name”,“Second Name”,“Third Name”];  
\_root.createEmptyMovieClip(“my\_mc”,1);  
my\_mc.\_x = 200;  
my\_mc.\_y = 200;

for (i=0;i\<name\_text\_array.length;i++) {  
my\_mc.attachMovie(“nameclip”,“nameclip\_mc”,1);  
my\_mc.nameclip\_mc.name\_text.text = name\_text\_array\*;  
removeMovieClip(“nameclip\_mc”);  
}

obviously this doesn’t work - what happens is that I get one iteration of the loop with the last value “Third Name” only displayed. I put a trace in the loop, and it does spit out all the text values correctly so I know the loop itself is iterating properly.

So in short what I want to happen is I want to see the movie clip 3 times, displaying each of the sequential array items.

I seem to be missing something! Please help!

thanks in advance!
