# Button.onRelease used before button is on stage problems

**URL:** <https://forum.kirupa.com/t/button-onrelease-used-before-button-is-on-stage-problems/31337>\
**Category:** Uncategorized\
**Created:** [September 21, 2003, 6:28pm UTC](https://forum.kirupa.com/t/button-onrelease-used-before-button-is-on-stage-problems/31337 "2003-09-21T18:28:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sliddick](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@sliddick](https://forum.kirupa.com/u/sliddick)\
**Post date:** [September 21, 2003, 6:28pm UTC](https://forum.kirupa.com/t/button-onrelease-used-before-button-is-on-stage-problems/31337/1 "2003-09-21T18:28:40Z")

</div>

is it not possible to define a button’s function before the button is on the stage.

here’s the specifics of my project. i have a “home.fla”. it’s basically the holder that will load in my section .swfs. i want to have all of my actionscript defined in my “home.fla”, including the button functions.

what i’m finding is that if i define a button’s function (a button that is in the yet to be loaded .swfs) before that button has been loaded, it won’t work.

is this right? it seems odd that i can define a normal function in the first scene of an .fla and call it in later scenes, loaded .swfs, ect. but i can’t do the same for button functions.

i’m uploading a sample file where i’m defining a button function in frame 1 for a button that doesn’t appear until frame 15 and it doesn’t work unless you either move the function definition to 15, or move the button to frame 1.

i don’t get it. any help will be greatly appreciated. thanks
