Button Script to Function

Hi, how can I take the following script which is attached to a button and separate it onto it’s own frame?

[AS]
on (release, keyPress “<Enter>”) {
if (email eq “”) {
stop ();
} else {
loadVariablesNum (“form.php”, 0, “POST”);
this.thanks.text = “Thank You!”;
}
}
[/AS]