# Call button function

**URL:** <https://forum.kirupa.com/t/call-button-function/212309>\
**Category:** flash\
**Created:** [January 10, 2007, 2:23am UTC](https://forum.kirupa.com/t/call-button-function/212309 "2007-01-10T02:23:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tyg3r](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/tyg3r/32/1341_2.png) [@Tyg3r](https://forum.kirupa.com/u/Tyg3r)\
**Post date:** [January 10, 2007, 2:23am UTC](https://forum.kirupa.com/t/call-button-function/212309/1 "2007-01-10T02:23:07Z")

</div>

I have a bunch of buttons. That when pressed call a seperate function. I do this so that if I wanted to play a video, I can put a command at the end telling it to launch to a new page automatically. Sooooo, I’d do this:

[AS]btn1.onPress = function() {  
page1();  
};  
function page1() {  
//dosomething  
};[/AS]

Is there a way to give an onPress/onRelease function a command that can be called, without having to write two seperate functions?

Wow, im confusing myself now. Any help?
