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.
onClipEvent(mouseDown){
formcheck();
}
That might work as an alternative.
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:
on (release) {
_parent.formcheck();//tell flash to look for the formcheck function on the timeline where the movieclip is located
}
claudio. thanks for the help, that totally worked out. Couldn’t figure the darn thing out. Thanks man.