# Using movie clip event handler function, but not for a movie clip

**URL:** <https://forum.kirupa.com/t/using-movie-clip-event-handler-function-but-not-for-a-movie-clip/195475>\
**Category:** flash\
**Created:** [August 1, 2006, 1:49am UTC](https://forum.kirupa.com/t/using-movie-clip-event-handler-function-but-not-for-a-movie-clip/195475 "2006-08-01T01:49:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashinapan](https://avatars.discourse-cdn.com/v4/letter/f/49beb7/32.png) [@flashinapan](https://forum.kirupa.com/u/flashinapan)\
**Post date:** [August 1, 2006, 1:49am UTC](https://forum.kirupa.com/t/using-movie-clip-event-handler-function-but-not-for-a-movie-clip/195475/1 "2006-08-01T01:49:23Z")

</div>

Let’s say I have the following code:

* * *

var initObj = new Object();  
initObj.mood = “happy”;  
mc = attachMovie(“mcBox”,“instBox”,100,initObj);  
mc.onPress = boxPress;

## function boxPress() { trace("Box mood: " + this.mood); }

Now, let’s say there are times that I want to call boxPress() other than when the onPress event happens. Is there a way I can set up an object, give it a “mood” property, and then run boxPress() so that it uses my non-movieclip object instead of a movie clip?
