# Form Reset Button Difficulties

**URL:** <https://forum.kirupa.com/t/form-reset-button-difficulties/183792>\
**Category:** Uncategorized\
**Created:** [March 30, 2006, 2:34am UTC](https://forum.kirupa.com/t/form-reset-button-difficulties/183792 "2006-03-30T02:34:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssjlegendx](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@ssjlegendx](https://forum.kirupa.com/u/ssjlegendx)\
**Post date:** [March 30, 2006, 2:34am UTC](https://forum.kirupa.com/t/form-reset-button-difficulties/183792/1 "2006-03-30T02:34:02Z")

</div>

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:

```auto

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!

---

<div class="post-metadata">

**Author:** ![Macaroni\_Ted](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@Macaroni\_Ted](https://forum.kirupa.com/u/Macaroni_Ted)\
**Post date:** [March 30, 2006, 9:39am UTC](https://forum.kirupa.com/t/form-reset-button-difficulties/183792/2 "2006-03-30T09:39:02Z")

</div>

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]

---

<div class="post-metadata">

**Author:** ![ssjlegendx](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@ssjlegendx](https://forum.kirupa.com/u/ssjlegendx)\
**Post date:** [March 30, 2006, 12:18pm UTC](https://forum.kirupa.com/t/form-reset-button-difficulties/183792/3 "2006-03-30T12:18:06Z")

</div>

:ne: Thanks! I’ll try that ASAP.

---

<div class="post-metadata">

**Author:** ![ssjlegendx](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@ssjlegendx](https://forum.kirupa.com/u/ssjlegendx)\
**Post date:** [March 30, 2006, 10:09pm UTC](https://forum.kirupa.com/t/form-reset-button-difficulties/183792/4 "2006-03-30T22:09:01Z")

</div>

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](http://Kirupa.com) tutorial found [U][here](http://www.kirupa.com/developer/actionscript/flash_php_email.htm)[/U]):

```auto
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](http://www.cherokee.k12.ga.us/cherokee-hs/salem/contactus.swf)[/U].  
You can view the entire website [U][here](http://www.cherokee.k12.ga.us/cherokee-hs/salem/index.html)[/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.
