# Centering attachMovies from different size Arrays

**URL:** <https://forum.kirupa.com/t/centering-attachmovies-from-different-size-arrays/249240>\
**Category:** flash\
**Created:** [January 16, 2008, 9:35pm UTC](https://forum.kirupa.com/t/centering-attachmovies-from-different-size-arrays/249240 "2008-01-16T21:35:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stickaforkinit](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@stickaforkinit](https://forum.kirupa.com/u/stickaforkinit)\
**Post date:** [January 16, 2008, 9:35pm UTC](https://forum.kirupa.com/t/centering-attachmovies-from-different-size-arrays/249240/1 "2008-01-16T21:35:32Z")

</div>

So, I have the following function…

buildLetter = function (x, y) {  
tmpStrWord = wordArray[nextWord].word;  
tmpStageArray = tmpStrWord.split("");  
shuffleArray(tmpStageArray,stageArray);  
for (i=0; i\<stageArray.length; i++) {  
var currLetter = this.attachMovie(“mcLetter”, “mcLetter”+i, i);  
currLetter.\_x = x+i\*(currLetter.\_width+distanceApart);  
currLetter.\_y = y-currLetter.\_height;  
currLetter.txtLetter.text = stageArray\*;  
}  
};

I need the attachedMovie clips to be centered on the stage no matter how long the array gets in terms of letters.

Oh and the size of letters cannot be scaled down.

Any ideas?
