-
Button skips actionscript
Hi
this is the code inserted for the actions of a "submit" button:
on (release) {
if (msgb eq "") {
errormsg("Please enter a comment.");
} else if (nameb eq "") {
errormsg("Please enter a name.");
} else {
unknown = "NO";
gotoAndPlay("record");
}
}
The weird thing: if you click on the button (and all the fields are not filled in), the form will be submitted (he goes to "record"). If you click a second time on the submit button (with still all fields not filled in), then he will give an error (please enter a comment).
What's the problem?
You can see this working at www.djmark.be -> contact -> guestbook
Thx!
-
I am not getting this problem. I am getting an error on the first try.
However, you definitely need to add a loading screen. I would suggest adding it to the blank page. I almost reloaded the site becuase I didn't know if the flash movie was broken. (it took a little while to load...)
-
That's very strange. I still get an error at the second click and not at the first click.
Thanks for the tip about the loading page.
-
you know what? when I tried it from home that's what happened. The first click didn't generate an error, but subsequent clicks did.... hrm.. let me look into this...
-
In the mean time, you may want to play with trace statements:
on (release) {
if (msgb eq "") {
errormsg("Please enter a comment.");
debug.trace("msgb = " + msgb);
debug.trace("the comment field was empty so I threw an error.");
} else if (nameb eq "") {
errormsg("Please enter a name.");
debug.trace("nameb = " + nameb);
debug.trace("the name field was empty so I threw an error.");
} else {
debug.trace("nameb = " + nameb);
debug.trace("msgb = " + msgb);
unknown = "NO";
gotoAndPlay("record");
}
}
Also, what is the "unknown" variable? what does it reference and why are you setting it to "NO"?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|