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

Lesson 17. Flash, ColdFusion, and the Da... > Sending Data Using Flash's loadVars ...

Sending Data Using Flash's loadVars Object

In this task, you'll switch back to Flash MX. As you'll recall, in the last lesson, you programmed a script that pulls data from five questions. The script also scores the answers, storing them under a variable named score. Your goal is to send the score and the username to a database. Thanks to the previous task, there is now a variable on the main timeline called username, which contains the email address of the user. The score variable is also on the main timeline. Just like the second form in the survey, which had all of the answers and the session variable collected in one place (many of them hidden) and just waiting to be inserted into the database with an Insert Record server behavior, these two pieces of data are ripe for sending.

Since the sending of data is initiated in Flash, you're going to write a little ActionScript to send it. Flash MX has a new feature, called loadVars, which is a special object used just for sending and loading data. This object is a special kind of object. Unlike a movie clip or a button, which are also Flash objects, the loadVars object is more conceptual than physical: You can't see it anywhere.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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