# Creating new event handler for MC

**URL:** https://forum.kirupa.com/t/creating-new-event-handler-for-mc/200162
**Category:** flash
**Created:** [September 9, 2006, 8:46am UTC](https://forum.kirupa.com/t/creating-new-event-handler-for-mc/200162 "2006-09-09T08:46:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Jayme65](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@Jayme65](https://forum.kirupa.com/u/Jayme65)
#### Post date: [September 9, 2006, 8:46am UTC](https://forum.kirupa.com/t/creating-new-event-handler-for-mc/200162/1 "2006-09-09T08:46:52Z")

</div>

In a kiosk application (with NO mouse action) I try to mimic the action of buttons…with movie clips.  
I was wondering if that would be possible to create new event handler for MC?  
So that, by script, I could tell something like:  
my\_mc.selected = true  
my\_mc.focused = true  
then have an event handler function like:  
my\_mc.onSelected = function () {  
trace (“button is pressed”);  
}  
my\_mc.onFocused = function () {  
trace (“button is on focus”);  
}

So:

1. a way to give a state to a movieclip (like “focused”, “pressed”…)
2. then an event handler…to handle corresponding function

Would you please have an idea on how I could achieve this?  
Thanks a lot!
