# Refering to a MC

**URL:** <https://forum.kirupa.com/t/refering-to-a-mc/210062>\
**Category:** flash\
**Created:** [December 14, 2006, 5:12pm UTC](https://forum.kirupa.com/t/refering-to-a-mc/210062 "2006-12-14T17:12:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neolumi](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/neolumi/32/1306_2.png) [@Neolumi](https://forum.kirupa.com/u/Neolumi)\
**Post date:** [December 14, 2006, 5:12pm UTC](https://forum.kirupa.com/t/refering-to-a-mc/210062/1 "2006-12-14T17:12:00Z")

</div>

Hi, I’m having a bit of trouble getting my head round this, I have some xml which is looping through and putting movieclips on the stage:

var currentThumb\_mc = port.attachMovie(“port\_item”, “thumbnail\_mc”+i,i);

how would i refer to the previous movieclip that was output, i’ve tried all sorts like:  
x = port.currentThumb\_mc + (i - 1);

anytime I try to strict data type the variable to object or movieclip it doesnt work, every once in a i while i get a NaN (Not a Number) error when tracing.

thanks!
