# Help with "MovieClip.onEnterFrame"

**URL:** https://forum.kirupa.com/t/help-with-movieclip-onenterframe/151654
**Category:** Uncategorized
**Created:** [June 17, 2005, 2:01am UTC](https://forum.kirupa.com/t/help-with-movieclip-onenterframe/151654 "2005-06-17T02:01:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![MaToMaStEr](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@MaToMaStEr](https://forum.kirupa.com/u/MaToMaStEr)
#### Post date: [June 17, 2005, 2:01am UTC](https://forum.kirupa.com/t/help-with-movieclip-onenterframe/151654/1 "2005-06-17T02:01:46Z")

</div>

I have this problem… imagine I’ve attached 4 MovieClips like this

```auto
for(i=1;i<=4;i++){
	this.attachMovie("MC","MC"+i,i);
}

```

Ok… everything it’s going fine… but… now I want to add the “onEnterFrame” function to the 4 of them… How do I do that ???

I’ve tried doing this :

```auto
for(i=1;i<=4;i++){
 	this.attachMovie("MC","MC"+i,i);
	this["MC"+i].onEnterFrame = function(){
		something();
	}
 }

```

And it WORKS !! But just for the Last MC attached !!!

Help please !!! THANKS !!! ☹
