# AS2 to AS3 conversion troubles

**URL:** https://forum.kirupa.com/t/as2-to-as3-conversion-troubles/290353
**Category:** flash
**Created:** [June 13, 2009, 7:55am UTC](https://forum.kirupa.com/t/as2-to-as3-conversion-troubles/290353 "2009-06-13T07:55:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![spirittoons](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@spirittoons](https://forum.kirupa.com/u/spirittoons)
#### Post date: [June 13, 2009, 7:55am UTC](https://forum.kirupa.com/t/as2-to-as3-conversion-troubles/290353/1 "2009-06-13T07:55:00Z")

</div>

ok i need to be able to create multiple similar sprites/movieclips inside of a for loop  
each new sprite/movieclip has to be names according to the number of “i” in the loop  
i know how to do it in AS2 but i have searched for methods for doing a similar thing in AS3 to no avail.

here is the code to successfully achieve this in AS2:

```auto
for ( var i = 0; i < 5; i ++ ) {
      
   // Create currentThumb MC
   var currentThumb = Scroller.allThumbs.createEmptyMovieClip ( "Thumb" + i, i );
   currentThumb._x += 10 + ( i * spacing );
   
   // Setting Data for all the thumbs etc

```

i know that to create movieclips in AS3 you need var MC:MovieClip = new MovieClip and all that  
but i need the dynamic names of movieclips

if its possible to have a Sprite container that loads in preset movieclips such as:

```auto
//creating many sprites
var sprite1:Sprite = new Sprite()
var sprite2:Sprite = new Sprite()
var sprite3:Sprite = new Sprite()
var sprite4:Sprite = new Sprite()

for ( var i = 0; i < 4; i ++ ) {
      
   // Create currentThumb MC
   var currentThumb = sprite + i;
   currentThumb._x += 10 + ( i * spacing );
   
   // Setting Data for all the thumbs etc

```

is there some way of converting this into AS3?  
thanks in advance for any assistance 🙂
