# MovieClip.onRelease = MovieCLip.Protoype function fails to execute properly

**URL:** <https://forum.kirupa.com/t/movieclip-onrelease-movieclip-protoype-function-fails-to-execute-properly/170404>\
**Category:** flash\
**Created:** [November 25, 2005, 4:51pm UTC](https://forum.kirupa.com/t/movieclip-onrelease-movieclip-protoype-function-fails-to-execute-properly/170404 "2005-11-25T16:51:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DDT](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@DDT](https://forum.kirupa.com/u/DDT)\
**Post date:** [November 25, 2005, 4:51pm UTC](https://forum.kirupa.com/t/movieclip-onrelease-movieclip-protoype-function-fails-to-execute-properly/170404/1 "2005-11-25T16:51:02Z")

</div>

Dear all,

I created a simpe function:

MovieClip.prototype.hiMe = function(me, theRest)  
{  
//declare the format colors white and grey  
formatMe = new TextFormat();  
formatMe.color = Colors[0];  
formatMe.font = “Adventure Subtitles”;

```
formatTheRest = new TextFormat(); 
formatTheRest.color = Colors[1];
formatTheRest.font = "Adventure Subtitles";

// assign grey to theRest
for (i =0 ; i &lt; theRest.length; i++)
{
    theRest*.tfield.setTextFormat(formatTheRest);
}
// make the me white
me.tfield.setTextFormat(formatMe);

```

}

when I call it (bar[0] is an array of objects)  
bar[0].invar.onRelease = hiMe(bar[0],bar);

it executes on load regardless of the onRelease eventHandler and the ownards it does not execute when exciting the event.

does somebody know why this may be?

Cheers

DDT
