- Creating and Sending eGreetings
- Preparing to Work
- Working with the Card Template
- Applying the Scrollbar
- Customizing the Scrollbar
- The eGreeting Interface
- Defining the Structure of the Database
- Using the LoadVars Object to Send Data
- Error Checking
- Setting Up and Testing the Email Program
- Displaying the Card for the Recipient
- Putting It All Together
Displaying the Card for the Recipient
Now you have a complete set of cards and a cardsender movie that works in conjunction with your server-side scripts, including one that successfully sends email to a recipient. The final piece needed is an ASP script to be run when the recipient receives an email and clicks on the link therein. Open showmycard.asp in Homesite or another editor. You'll note three parts to this file:
The HTML frame for the page, with a title, standard HTML tags, and a table structure that makes sure the card will appear centered both horizontally and vertically within the browser window.
A VBScript section that looks in the database and extracts the information about the selected card.
The OBJECT and EMBED tags used to open the .swf with a querystring appended. This, for example, is the PARAM tag, which is part of the OBJECT that Internet Explorer will use to display the movie:
<PARAM NAME=movie VALUE="card<%=cardID%>.swf?fromBrowser=1& toName=<%=toName%>& toEmail=<%=toEmail%>& fromName=<%=fromName%>& fromEmail=<%=fromEmail%>& message=<%=message%>">
Code Listing 11: PARAM tag that includes VBScript to pass ASP variables to the Flash card movie.
You create these tags by publishing the card .swf and then manually appending the information you need to pass to the movie. When cardnn.swf is executed, parameters passed in this way are automatically available for use as _root variables in frame 1.
Figure 10.12. The contents of showmycard.asp. This file was produced by publishing card01.fla to card01.html, which was then modified in Homesite to include VBScript to access the database, HTML tags for a table cell display of the card, and addition of VBScript tags to pass parameters to the card movie.