Skip to main content
Participant
September 17, 2007
Question

Actionscript 2.0 Tutorials for FORMS

  • September 17, 2007
  • 4 replies
  • 392 views
Hi Out There:

Does anyone have info on how to make forms actually work on a website? I work in Flash Professional 8 as a designer/animator, but am at a total dunce when it comes to forms. My desired fields are set up as follows (actually copied and pasted from my fields movie), and tabs great when sitting at my computer. But there it all ends.

//stops things from goofing up.
stop();

//NOTE: if buttons are components, set their actions by cliking on them and adding action script

//sets tabindexes for components
InName.tabIndex=1
InOrg.tabIndex=2
InStreetAddress.tabIndex=3
InCity.tabIndex=4
InState.tabIndex=5
InZip.tabIndex=6
InEmailAddress.tabIndex=7
InEnquiry.tabIndex=8
InSend.tabIndex=9

//the following sends the viewer to my excuse page pending the day (if ever)
//I get things working.

InSend.onRelease=function(){
gotoAndStop("excuse");
};

InCancel.onRelease=function(){
gotoAndStop("Out");
};
This topic has been closed for replies.

4 replies

Inspiring
September 20, 2007
I posted the PHP, AS2 and AS3 versions of a basic contact form on my site. If you have any questions, post a comment on the post or send me a direct e-mail.

http://sd-dezign.com/blog/?p=40
Inspiring
September 20, 2007
The FLA is CS3 and uses AS3 code so saving it in Flash 8 format isn't going to help. The mail.php file is a bare bones file and will work for any version of Flash. For Flash 8 AS2, look into the LoadVars class. I'll try to add a post tomorrow showing the AS code for AS2 and AS3.
September 20, 2007
Thanks so much!

Mark
COOSAAuthor
Participant
September 18, 2007
Hi and Thanks for Response:

I downloaded from your site. Dreamweaver Document (mail.php) opened fine, but the Contactform.fla document would not open. Do I need it? I run MacOS 10.4.9.
Inspiring
September 17, 2007
You need a few things first.

One is a php/asp file that is going to do whatever you need to do with this form data i.e. e-mailing it to a central internal e-mail account to be processed.

The second is a LoadVars class object that stores all of your text field text properties to identically named (to the php/asp) variables that can be sent via POST through a sendAndLoad call.

The third is another LoadVars class object that will handle whatever data you need to get back from the php/asp file i.e. success code of some sort so that you can display a valid message to the user about what did/didn't happen with the form. The second LoadVars object will be sent as an arguement to your first LoadVars sendAndLoad call.

Find a decent php/asp file on the web, there a plenty of pre-built ones out there. As a matter of fact, a php version can be downloaded from my site (part of an AS3 contact form) - http://www.sd-dezign.com/files/as3contact.zip Feel free to e-mail me with question but the file is pretty simple and a good starting ground for what you need (assuming you are using PHP).

The LoadVars class is pretty well documented in the AS2.0 Help Files inside Flash but if you need help, feel free to ask about that as well.
September 20, 2007
Could you save your fla file down to Flash 8? I also have been trying to get my flash form to send e-mail.

Thanks so much,
Mark