Using ColdFusion to process Flash form submissions

page 2

 

Select the first frame in the form layer. Add a text box and type Name as the label for the first field using the text tool. Next to the label add another empty text box. With this text box selected open the Text Options panel. Change the type to Input Text, single line. In the variable field type txtName, this is the name that will be used to refer to the field's contents.

Add two more fields, txtEmail and txtComments. For the comments field select multiline and check the word wrap box.

So far creating the form has not been unlike creating an HTML form. For the rest of the form things are a bit different. Checkboxes and submit buttons are not built-in features in Flash 5.

This isn't as bad as it sounds, if you look in the common libraries (on the Window menu) you will find a selection of buttons to choose from under Buttons, and in the Smart Clips Common Library you will find a check boxes and radio buttons.

To add a checkbox to the form, drag a checkbox from the common library to the position you want it on your form. Select the checkbox and open the Clip Parameters panel from the Window-panels menu. In the value column enter cbMailing for _name and Please mail me in the defaultValue.

The final thing we need on the form is a submit button. Find one you like in the common libraries, I used the Pill Button. Just drag it onto the stage. You can resize it by selecting the button you've just dropped on the stage and adjusting the height and width. If you don't like the colour you can modify that too, using the effects panel.

You can also write text on top of the button, this won't change with the button state, but it'll do for the purpose of this example.

On the artafterscience guestbook I wanted a circle to appear behind the form field. To do this I added another layer, added the keyframes and dragged it to the bottom of the list of layers so it was behind the form layer and drew a circle.

Now you should have a form similar to the one below:

The guest book form

If you test the movie (Ctrl-Enter) you'll be able to type data into the text fields, but nothing happens when you click submit. On the next page we'll find out why.

 

«previous | next page»