# Dynamically Reference a MovieClip?

**URL:** https://forum.kirupa.com/t/dynamically-reference-a-movieclip/245220
**Category:** flash
**Created:** [November 27, 2007, 4:47pm UTC](https://forum.kirupa.com/t/dynamically-reference-a-movieclip/245220 "2007-11-27T16:47:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mediumman](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mediumman/32/551_2.png) [@mediumman](https://forum.kirupa.com/u/mediumman)
#### Post date: [November 27, 2007, 4:47pm UTC](https://forum.kirupa.com/t/dynamically-reference-a-movieclip/245220/1 "2007-11-27T16:47:58Z")

</div>

I have a variable setup for a specific movieClip and i want to be able to reference that movieclip with an i++ …I am specifically talking about the “new\_mc” variables…they don’t seem to be picking up in the function…when i trace them they are correct, but just aren’t working…there must be something wrong with my variable declarations, I can’t figure it out…below is some of my code…any help is appreciated…

i = 0;  
maxpics = 50;  
maxer = maxpics - 1;  
pic\_slider = “easeOutCirc”;  
mask\_slider = “easeOutCirc”;  
speed = 1;

var new\_mc = “\_level0.mc.m1.p”+ (i+2);  
var new\_mc2 = “\_level0.mc.m1.p” + (i+1);

\_global.forwarder = function() {  
if (i == i && i == maxer){  
break;  
}  
else if (i == i) {  
mc.slideTo((mc.\_x-((new\_mc.\_width/2)+(new\_mc2.\_width/2))),mc.\_y, speed ,pic\_slider);  
mc2.slideTo((mc.\_x-((new\_mc.\_width/2)+(new\_mc2.\_width/2))),mc.\_y, speed ,pic\_slider);  
masker.tween("\_width",new\_mc.\_width, speed ,mask\_slider);  
i++;  
}  
};
