I’m currently using Flash MX to design a website for a class at school.
I’ve made an email form (using Flash and PHP), and everything *seems *to be working fine; however, I went back to add a simple “Clear” (or “Reset”) button at the end of the form, and this is where I ran into problems…
I’ve found about a dozen different ActionScript methods that will *supposedly *accomplish this task, but none have worked thus far.
Currently, I have on the button itself:
on (press) {
name.text = "";
email.text = "";
message.text = "";
}
On the form (a movie clip that does not contain the button), there are three input text fields, with variables “name,” “email,” and “message.” I’ve tried the script both with and without “.text” appended to the end of the variable names. I’ve also tried giving the text fields instance names (rather than specififying variables), but my button still does nothing.
Thanks in advance for any help. I’ll try whatever possible tomorrow, for I do not have access to Flash MX at home. Again, thanks!
unless the text fields are within the button its self then it wont ill be something like this.
[AS]
//if the text is on the main timeline
on (press) {
_root.name.text = “”;
_root.email.text = “”;
_root.message.text = “”;
}
// or
//if its in a movie on the timeline eg…myMCname
on (press) {
_root.myMCname.name.text = “”;
_root.myMCname.email.text = “”;
_root.myMCname.message.text = “”;
}
[/AS]
:ne: Thanks! I’ll try that ASAP.
Okay, so…
I got the button working… in a way. Using the code provided (thanks again!) without the “.text” after the variable names ultimately worked.
When testing the page or viewing its exported .swf, there are no problems; the submit button works and redirects to the next slide, which was done using the following script (as given on the Kirupa.com tutorial found [U]here[/U]):
onClipEvent(data){
_root.nextFrame();
}
The email form is within a movie clip on a .swf file. This .swf, in turn, loads into another movie clip (“placeholder”) within the main flash site.
As I said, when previewing just the file with the email form, everything seems to work properly; however, when loaded into the website, the buttons are clickable, but neither the “Send” nor the “Clear” (or “Reset”) buttons work.
You can view the form .swf [U]here[/U].
You can view the entire website [U]here[/U].
My only guess (based on reading other forum posts) is that I need to replace “_root” with “_parent” throughout my script, but since I cannot test anything unless I am at school, I cannot be sure.
My teacher is stumped about this, as well. Again, any help would be extremely appreciated. Thanks.