# \[MX\] Movieclips With the Same Function

**URL:** <https://forum.kirupa.com/t/mx-movieclips-with-the-same-function/44453>\
**Category:** flash\
**Created:** [March 4, 2004, 1:56am UTC](https://forum.kirupa.com/t/mx-movieclips-with-the-same-function/44453 "2004-03-04T01:56:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![foochuck](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@foochuck](https://forum.kirupa.com/u/foochuck)\
**Post date:** [March 4, 2004, 1:56am UTC](https://forum.kirupa.com/t/mx-movieclips-with-the-same-function/44453/1 "2004-03-04T01:56:01Z")

</div>

I have 3 movieclips on my main timeline - 1 MC for each frame.

The movie clips are named image1\_mc, image2\_mc, image3\_mc .

I want to have all 3 mcs have this code on them:

```auto

image1_mc.onEnterFrame = function() {
if (this._alpha < 99) {
this._alpha += 5;
}
}

```

Is there a way to dynamically create this code for all 3 MCs if they aren’t all on the starting frame?

:p:
