# Function invoke b4 onPress

**URL:** <https://forum.kirupa.com/t/function-invoke-b4-onpress/85077>\
**Category:** Uncategorized\
**Created:** [April 1, 2005, 4:15pm UTC](https://forum.kirupa.com/t/function-invoke-b4-onpress/85077 "2005-04-01T16:15:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hydrowire](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@hydrowire](https://forum.kirupa.com/u/hydrowire)\
**Post date:** [April 1, 2005, 4:15pm UTC](https://forum.kirupa.com/t/function-invoke-b4-onpress/85077/1 "2005-04-01T16:15:41Z")

</div>

```auto
goto = function(where:String) {
	 getURL("http://esample.com/"+where+".htm","_self");
}

button1.onRelease = goto("home");

```

when the movie loads, flash immediately ‘getURL’ BEFORE i press my button1. how come the code execute even before i press it 1st? what’s wrong with my code?

thx in advance.
