Using my_mc.onRelease style functions

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:

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