# Using my\_mc.onRelease style functions

**URL:** <https://forum.kirupa.com/t/using-my-mc-onrelease-style-functions/203586>\
**Category:** flash\
**Created:** [October 12, 2006, 8:50am UTC](https://forum.kirupa.com/t/using-my-mc-onrelease-style-functions/203586 "2006-10-12T08:50:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iLikePie](https://avatars.discourse-cdn.com/v4/letter/i/85f322/32.png) [@iLikePie](https://forum.kirupa.com/u/iLikePie)\
**Post date:** [October 12, 2006, 8:50am UTC](https://forum.kirupa.com/t/using-my-mc-onrelease-style-functions/203586/1 "2006-10-12T08:50:23Z")

</div>

hi,

I’m creating a little test within flash, so i will have a series of questions, each with a yes or no answer.  
there are a few differnet variables being measured, so i was going to make some functions for when a button is pressed.

my question is this - I want to use this code:

```auto
my_button.onRelease = function(){
varAB += 1;
}

```

there would be four such pieces of code, with different button names.

but I am encountering that problem where if the button isn’t actually present on the frame in which the code is written, it doesn’t apply it. And because not all the buttons are present each frame, this would mean i have to copy and paste all those code snippets onto EVERY frame.

is there something i’m not understanding here?

thanks,  
Stuart
