# Formcheck()

**URL:** <https://forum.kirupa.com/t/formcheck/111401>\
**Category:** Uncategorized\
**Created:** [May 26, 2004, 4:41pm UTC](https://forum.kirupa.com/t/formcheck/111401 "2004-05-26T16:41:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dude9er](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dude9er](https://forum.kirupa.com/u/dude9er)\
**Post date:** [May 26, 2004, 4:41pm UTC](https://forum.kirupa.com/t/formcheck/111401/1 "2004-05-26T16:41:44Z")

</div>

I have a form that uses PHP to check to see if all variables are filled in. I have a button with

on (release) {  
formcheck();  
}

that checks the formcheck function and then sends the form or gives a popup that tells what part of the form needs to be filled in.

My problem is that I have a movie that I’d loike to act as a button. I’ve done this before with any other command (gotoAndPlay, getURL, etc), but the

on (release) {  
formcheck();  
}

does not work with a mc button, only with a regular button. Does anyone know a way around this, or why it does not work?

Thanks in advance.

PS Using MX over here.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 26, 2004, 4:49pm UTC](https://forum.kirupa.com/t/formcheck/111401/2 "2004-05-26T16:49:29Z")

</div>

onClipEvent(mouseDown){  
formcheck();  
}

That might work as an alternative.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 26, 2004, 4:52pm UTC](https://forum.kirupa.com/t/formcheck/111401/3 "2004-05-26T16:52:03Z")

</div>

Whenever using a static event handler on a button, the scope of the code is the timeline where the button is located. That means flash will search that timeline for a function named formcheck, that indeed exists.  
But on a movieclip, the scope is the timeline of the movieclip itself. So flash will look for a function named formcheck inside the movieclip and it will fail, as it doesnt exist.  
To work around that, apply this on your movieclip:

```auto
on (release) {
	_parent.formcheck();//tell flash to look for the formcheck function on the timeline where the movieclip is located
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 26, 2004, 5:16pm UTC](https://forum.kirupa.com/t/formcheck/111401/4 "2004-05-26T17:16:32Z")

</div>

claudio. thanks for the help, that totally worked out. Couldn’t figure the darn thing out. Thanks man.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 26, 2004, 5:32pm UTC](https://forum.kirupa.com/t/formcheck/111401/5 "2004-05-26T17:32:51Z")

</div>

Glad i could help =)
