# Targeting dynamically created movie clip?

**URL:** <https://forum.kirupa.com/t/targeting-dynamically-created-movie-clip/149087>\
**Category:** flash\
**Created:** [May 25, 2005, 9:28pm UTC](https://forum.kirupa.com/t/targeting-dynamically-created-movie-clip/149087 "2005-05-25T21:28:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![imported\_East\_High](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/imported_east_high/32/1331_2.png) [@imported\_East\_High](https://forum.kirupa.com/u/imported_East_High)\
**Post date:** [May 25, 2005, 9:28pm UTC](https://forum.kirupa.com/t/targeting-dynamically-created-movie-clip/149087/1 "2005-05-25T21:28:06Z")

</div>

So I got this little array going on, right? And I’d like to set it up so that you’d loop through the pics by clicking on the dynamically created movie clip “container\_mc”. This ain’t working so I’ve resorted to putting an invisible mc over the pics to do this job. I know it has to be possible to target the “container\_mc” because that’s its instance name. I’ve tried “this.onPress” and “\_level1.container\_mc.onPress” and just plain ol’ “\_root.container\_mc.onPress”, but nothing works. :fight:

Can anyone shed some light on this for me?  
Here’s my puny code.

```auto
stop();
pics = new Array("01.jpg", "02.jpg", "03.jpg");
_root.count = 0;
createEmptyMovieClip("container_mc", 1);
loadMovie(pics[_root.count], "container_mc");
container_mc._x=200, container_mc._y=60;
////////////////
button_mc.onPress = function() {
	_root.count++;
	if (_root.count>2) {
		_root.count = 0;
	}
	loadMovie(pics[_root.count], "container_mc");
	trace(count);
};

```
