A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11303 Flash Movies | 7 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Nitin Tikhe
» Title: Cart
» Description: This Animation Tut is a fun and useful for kids below 15 years. Watch the Flag, Doors, Stick and Horse movements.
» More by Nitin Tikhe


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

Featured Site

» Posted in the Flash Kit Links section
» Title: Banana Swimwear
» Description: This is a banana swim wear interactive catalog we designed and animated in Flash


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

» Make flash video player for broadcasting live streaming video / TV on website
» How to convert the project file of Flash Demo Builder 2.0 into FLV file
» FLV to PSP for Mac - How to convert YouTube video to PSP on mac
» How to Convert FLV to MP4 for Playback on iPod
» how to download and convert youtube video to AVI with Leawo Free FLV converter
» Flash Multi-player Game Tutorial - TicTacToe
» How to make Flash elearning tutorials with screen recorder?
» Fader API:Slideshow with MovieClips on stage
» How to convert MS PPT file into an FLV File
» Unknown Tag: Title10
Random Tutorial | Add Site

Network Design Manager
The Computer Merchant, Ltd
US-VA-Hampton

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.50 Votes: 119
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