• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Part: 7 Flash and ColdFusion PROJECT 2: ... > Flash, ColdFusion, and the Database

Lesson 17. Flash, ColdFusion, and the Database

In this lesson, you will complete the Dante quiz project, and with it, the book. From the title of this lesson you might think that this is the hardest lesson in the book, in fact, the hard part is already behind you. In this lesson, you'll connect all the pieces—Flash, the HTML pages, and the database—and do little else. Working with ColdFusion is often like setting up a VCR to your cable and your TV: The complicated parts are in the TV and VCR, but all you need to worry about is connecting a wire from one to the other.

You will save two pieces of data in Macromedia Flash—the username and score variables—into a database. You will send this data to ColdFusion, and then ColdFusion will insert it into a database.

This page is accessed via Flash, which sends data via the URL (notice the variables in the URL) when it calls the page. ColdFusion outputs the URL data in the page and also inserts it into a database.

Flash offers several means of sending data in and out to a ColdFusion (or ASP, PHP, or JSP) script. Some of these options are robust, such as Flash Remoting and Web Services, while other options are comparatively simple. One useful technique is to use Flash's LoadVars object, which makes it easy to send and load name-value pairs from a text file or ColdFusion template. An even more primitive—but effective—approach is to pass data via the URL. As you'll recall, in Lesson 16, “A Component-Based Flash Quiz,” when you inserted the Flash movie, using HTML's <object> and <embed> tags, you appended a variable: flash/dante_quiz.swf?username=<cfoutput>#form.username#</cfoutput>. This variable was sufficient to get the username variable into Flash. One or more variables appended to the end of a URL in this way is called a querystring, and is a common approach to sending data between pages. In this lesson, rather than bringing data into Flash using a querystring, you'll send data out of Flash, using a querystring.


In this lesson, you will:

  • Finish the Flash quiz, sending data to ColdFusion

  • Use ColdFusion to output the data in the HTML page

  • Use ColdFusion to insert the data into a database

  • Improve security by moving the data out of the URL


This lesson takes approximately 45 minutes to complete.


Starting Files:



Completed Files:





Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint