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

Trading Customer Accounting (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 Sending Customized Flash E-cards
Author: Jeffrey F. Hill | Website: http://www.flash-db.com |

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

Part 1 - Setting up the Main Flash Movie

The main Flash movie (Ecards.fla) is your base of operations. This file allows the user to select the e-card they want to send, then allows them to enter custom text which will be sent along with the e-card when they send it to a friend or anyone else they want to. By opening up the Flash Fla file and going over it first you will have a much better understanding of the part that I'm going to go over next. This part of the tutorial is not really necessary if you already have a good working knowledge of Flash 5.

The fla file contains a movie clip named 'ECards'. This movie clip has 5 frames, each frame contains an image of the Ecard you want to send out. This movie clip is used 5 times (1 time for each e-card that you want to allow users to select from). Their are 5 different instances of the movie clip 'ECards', each instance is used to display a different frame of the movie clip - which corresponds to a different image of an e-card. Setting instance Names.

The first image to the right demonstrates this point. This is the first instance of the movie clip 'ECards', their are 5 other instances with instance names of Ecard2, Ecard3, Ecard4, Ecard5, etc. You should be able to easily change this part or add new ones to the list.

In the first frame of the layer 'Actions' their are a couple of lines of actionscript which tell each e-card what frame to display. For example Ecard4 is told to gotoAndStop at frame 4. On frame 4 of their is a preview image of Ecard 4. These commands are shown in the second image to the left. They can also be found in the fla file.

Over each Movie Clip their is a button. This button allows users to select which card they want to send by clicking on it. The buttons contain the following actionscript.

on (release) {
 gotoAndStop (2);
 EcardSelect = "1";
}

This tells the main movie to gotoAndStop at frame 2. And also sets the variable EcardSelect equal to 1. The actionscript on the button over the second e-card would be exactly the same except the variable EcardSelect would be set equal to 2. The EcardSelect variable will be used throughout.

This brings us to Frame 2 of the main Ecard Movie. This frame contains the actionscript that sets up the preview image of the card that was chosen and also the actionscript that checks the custom text fields and post's that information to the PHP script that sends the card.

In the second frame of the layer 'Actions' their is a line of actionscript as follows:

_root.EcardPreview.gotoAndStop(EcardSelect);

The 'ECards' Movie clip is again used, only this time it is given an instance name of 'EcardPreview'. This line of actionscript tells this instance of ECards to go to and stop at the frame that corresponds to the variable EcardSelect - that was set when the user clicked on a specific E-card.


Their are a number of text fields in this frame. They are all input text fields. Make sure that you do not have the 'html' checkbox checked off for these text boxes.

The text fields are given the variable names: ToName, ToEmail, FromName, FromEmail, Greeting, and IntroMessage. An example of the text box with the variable name 'ToName' is given to the right. One thing you may want to do is set the Max Chars limit. In this case the limit was set to 70 Characters. In the case of the IntroMessage text you should try to set a limit so that the text is not cut off in your greeting card when somebody sends it.

The last part of setting up the main 'Ecards.fla' file includes sending the custom information to a script which then processes that information.

On the 'Click here to send e-card' button you will find the following text:

on (release) {
 if (ToName eq "") {
 _root.Status = "Please enter the Name of the person your sending this to";
 } else if (FromName eq "") {
 _root.Status = "Please enter your Name";
 } else if (ToEmail eq "") {
 _root.Status = "Please enter the Email address your sending this to";
 } else if (FromEmail eq "") {
 _root.Status = "Please enter your email address";
 } else if (Greeting eq "") {
 _root.Status = "Please enter a greeting message";
 } else if (IntroMessage eq "") {
 _root.Status = "Please enter a Intro Message";
 } else {
 gotoAndStop (3);
 _root.Status = "Sending Ecard - Please Hold";
 loadVariablesNum ("SendEcard.php", 0, "POST");
 }
}

The first couple if-else statements just check to make sure that the user filled all the fields out. Then if they did it tells the main movie to go to and stop at the 3rd frame of the movie - where the user will see a success 'the message has been sent' notification. Also the loadVariablesNum command post's all of the variables in the movie to a script which later processes the results.

«prev 1 2 3 4 5 6 7 8 9 next»

» Level Advanced

Added: : 2001-12-04
Rating: 8.51 Votes: 120
Hits: 5171
» Author
Jeffrey Hill is a freelance web developer from Boulder, Colorado. He specializes in creating and developing dynamic database driven Flash content. Being a recent graduate of the University of Colorado - he somehow finds time to write these tutorials.
» Download
Download the files used in this tutorial.
Download (426 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