# Calling multiple similarly named objects in a function

**URL:** <https://forum.kirupa.com/t/calling-multiple-similarly-named-objects-in-a-function/295181>\
**Category:** flash\
**Created:** [August 26, 2009, 11:58am UTC](https://forum.kirupa.com/t/calling-multiple-similarly-named-objects-in-a-function/295181 "2009-08-26T11:58:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![smgDesign](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@smgDesign](https://forum.kirupa.com/u/smgDesign)\
**Post date:** [August 26, 2009, 11:58am UTC](https://forum.kirupa.com/t/calling-multiple-similarly-named-objects-in-a-function/295181/1 "2009-08-26T11:58:51Z")

</div>

Hello, guys and thanks for reading this 🙂

I’ve got an issue with resizing multiple similarly named objects.

I’ve got the following code that works:  
mc0.nb0.autoSize = “left”

nb0 is a text box placed inside mc0, which is a movie clip. My script simply resizes the box, according to the ammount of text inside it.

what I’m trying to achieve is a more dynamic code that would work for no matter how many boxes…

I tried something like “mc”+i.“nb”+i.autoSize = “left”, but I get a syntax error. So, how do I call the MC inside the function?

Help is much appreciated…
