# Loading a named function for a button

**URL:** <https://forum.kirupa.com/t/loading-a-named-function-for-a-button/48807>\
**Category:** Uncategorized\
**Created:** [April 16, 2004, 10:05pm UTC](https://forum.kirupa.com/t/loading-a-named-function-for-a-button/48807 "2004-04-16T22:05:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Disco\_Stu1](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@Disco\_Stu1](https://forum.kirupa.com/u/Disco_Stu1)\
**Post date:** [April 16, 2004, 10:05pm UTC](https://forum.kirupa.com/t/loading-a-named-function-for-a-button/48807/1 "2004-04-16T22:05:47Z")

</div>

Is there any way to get a button to perform a named function? ie:

Instead of this

```auto

contact_b.onPress = function () {
	getURL("javascript:var mypopup = window.open('contact.htm','Contact','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=200,height=290,top='+eval((screen.availHeight - 300) / 3)+',left='+eval((screen.availWidth - 500) / 2));mypopup.focus();");
}

function contact() {
getURL("javascript:var mypopup = window.open('contact.htm','Contact','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=200,height=290,top='+eval((screen.availHeight - 300) / 3)+',left='+eval((screen.availWidth - 500) / 2));mypopup.focus();");
}

```

could i make something like

```auto
contact_b.onPress = function () {
	"insert load function:contact thing here"
}

function contact() {
getURL("javascript:var mypopup = window.open('contact.htm','Contact','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=200,height=290,top='+eval((screen.availHeight - 300) / 3)+',left='+eval((screen.availWidth - 500) / 2));mypopup.focus();");
}

```

I use this function for dynamic text asfunction links in loaded movies and such, and it would be easier, and smaller if i could just get it to load the function…
