A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11336 Flash Movies | 2 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Surjit Dhami
» Title: Book
» Description: Book
» More by Surjit Dhami


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

Featured Site

» Posted in the Flash Kit Links section
» Title: All-American Rejects
» Description: Get to know this great band by exploring their "practice room".


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

» Create xml slideshow with free template
» How to Insert a Multilingual Subtitle Into Your Flash Video Studio
» How to Create Cool Halloween Slideshow
» Debugging flash using the Firebug console
» Create Flash Slideshow on Blogger
» FLASH TRICKS IN WEB ADVERTISING: FLASH BANNERS
» HTML Photo Gallery Tutorial
» Create your first flash site – PART 1
» How to Make a Flash Photo Gallery
» Unknown Tag: Title10
Random Tutorial | Add Site

Webmaster (IL)
Next Step Systems
US-IL-Chicago

Justtechjobs.com Post A Job | Post A Resume


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.95 Votes: 191
Hits: 9606
» 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
 
   
 

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs