Internet Commerce

Partners & Affiliates

Developer Channel


Featured Flash FLA
Gallery Downloads 11401 Flash Movies | 5 New Flash Movies Added
What's New | Top 100

Featured FLA

»  Author: Nick Kouvaris
»  Title: Znax
»  Description: Znax is a board game. Click 4 tiles of the same color and form squares as big as you can. You will erase all the tiles inside the square and collect points. Get maximum score if you make a square with game edges.
»  More by: Nick Kouvaris


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 4941 Flash Sites | 1 New Flash Links
What's New | Top 100 Flash Site

Featured Site

»  Author Agence WOP Digital Agency
»  Title: Electricdrum
»  Description: French WOP Agency, 3D websites, Flash (Papervision, Away 3D), event or institutional projects. The agency operates on all digital projects: consulting, design, graphic design, development, online communication. The WOP agency follows you on the implementation of original, creative and optimized digital projects.


Random Links | Add your own Flash Related Links
Flash Tutorials 1481 Tutorials 7 New Tutorials Added!
What's New | Top100

» How To Make A Simple Animation Using Christmas Clips
» Simple Step by step flash game tutorial Spot the diffrence
» How To Make A Moving Text Slide
» Create Flash Banner With Text Float Effect
» How To Make Zoo Photos Slideshow
» How To Make A Dolphin Photos Slideshow
» How To Make A Fathers Day Slideshow
» How To Make A Transparent Background of Your Flash File
» Create Flash Banner With Text Disco Light Effect Today we will introduce you a Text Disco Light eff
» Unknown Tag: Title10
Random Tutorial | Add Site


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Dynamic_Content

Categories Creating a simple Guest Book in Flash
Author: Jeffrey F. Hill | Website: http://www.flash-db.com |

 
Page 3
«prev 1 2 3 4 5 6 7 next»

c) Setting up the Guest Book entry Form

The main Guest Book entry (or submission) form is shown to the left.  This consists of 4 input text boxes and 2 buttons.  The entry forms are located inside of a movie clip. Their is no need to give this movie clip an instance name in this case.  Also in the Fla, above this form their is an additional text field named 'Status' - this is used to display messages to the user when filling out the form and submitting it.

The 4 input text boxes are named: Name, Email, Website, and Comments - respectively.  The first 3 are single line text boxes.  The comments text box is a multi-line input text box.  Make sure that you do not check the 'HTML' check box off for any of these.  Also it's always a good idea to set the max number of characters (max Chars) that can be entered in these boxes (especially the Comments text box) otherwise people will be able to enter large amounts of text into the comments area.  In my example I have the comments limited to 240 characters - you can change yours to whatever you want.  That's just one way to check how much data has been entered, you should add other checks to limit the amount of text entered if you feel it's necessary.

The following code is located on the Submit button:

on (release) {
 if (Name eq "") {
 _root.Status = "Please enter your name";
 } else if (Email eq "") {
 _root.Status = "Please enter email Address";
 } else if (Website eq "") {
 _root.Status = "Please enter the URL to your website";
 } else {
 Submit = "Yes";
 NumHigh = 10;
 NumLow = 0;
 _root.GuestBook = "Processing..   Loading New... ";
 loadVariablesNum ("GuestBook.php", 0, "POST");
 _root.Status = "Your entry has been submitted.  You should see your comments appear immediately";
 gotoAndStop (2);
 }
}

The first portion of this code checks to make sure that the fields where filled out.  If they where not filled out correctly an error message will appear in the Status Text box.

If everything was filled out successfully the variable Submit is set to 'yes'.  This is an important aspect and will be further explained in the PHP script.  Then the variables NumHigh and NumLow are set again to their default values of 0 and 10, respectively.  The Guest book text field is then assigned a temporary value to let the user know that the entries are being loaded.  The next line uses the loadVariablesNum function to send all of the variables in this movie clip to the script which will add the entry to our text file database.  After that a success message is shown in the Status text field and the movie clip goes to the second frame where a Thank You message is displayed.

At this point the script is called, where it adds the new entry and returns the new entry as well as the others back to the Flash movie.   In this way the user will see his entry appear in the Guest book right after the submit button is pressed.

«prev 1 2 3 4 5 6 7 next»

» Level Advanced

Added: : 2001-12-21
Rating: 8.93 Votes: 198
Hits: 9621
» Author
Jeffrey Hill is a freelance web developer from Boulder, Colorado. He specializes in creating and developing dynamic database driven Flash content and applications. Specialty's include SQL, PHP, Perl, and XML.
» Download
Download the files used in this tutorial.
Download (55 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments