Presentation is loading. Please wait.

Presentation is loading. Please wait.

Flash Database Access Passing Variables to Flash and Storing Flash Interaction Results in an Access Database.

Similar presentations


Presentation on theme: "Flash Database Access Passing Variables to Flash and Storing Flash Interaction Results in an Access Database."— Presentation transcript:

1 Flash Database Access Passing Variables to Flash and Storing Flash Interaction Results in an Access Database

2 Flash Database Access Storing Flash interaction results is a four- step process. First, you identify the user whose results you will be saving. Second, you send this user to the page in which the Flash interaction is embedded. Third, you program the Flash interaction to post the results to an ASP page. Fourth, you make the ASP page receive the results and save them in the database.

3 Identifying the User FlashQuizIdentifyUser.htm The simplest way to identify the user is to use an HTML form to prompt for some kind of identification, such as an e-mail address You save this ID in a session variable so the browser knows who the user is. You should also pass this ID to Flash in order that your Flash code will know who the user is.

4 Session Variable Coding FlashQuizAskQuestions.asp You embed the Flash movie on an ASP page upon which you can write ASP code to receive and forward the data from the ID form. To save the user’s email address in a session variable, the ASP code is: To pass this data to the embedded Flash movie object, you modify the object’s movie parameter as follows: ">

5 Posting the Quiz Results FlashQuiz.fla At the end of the Flash quiz, you provide the user with a button which, when clicked, posts the quiz results to the ASP page to which you will take the user upon completion of the quiz. The format of this ActionScript is as follows: report_btn.onRelease = function() { score = (iNumberCorrect / iNumberAsked) * 100; getURL(“FlashQuizStoreResults.asp", "_self", "POST"); }

6 Displaying the Data FlashQuizStoreResults.asp On the page to which Flash posts the data, you create a binding to Request(“score”) and to Request(“email_address”). Now you can use these bindings to display the data onscreen. For example: The result of the quiz was for At runtime, this writes a message in the form of: The result of the quiz was 33% for Elvis@graceland.com.

7 Storing the Results in the DB FlashQuizStoreResults.asp To store the results in the database, you create a Dreamweaver connection to your Access database. On the page that will store the quiz results, you use the Application toolbar’s Command component to create the SQL command that will insert the data into the database.

8 Configuring the SQL Command FlashQuizStoreResults.asp

9 Viewing the Quiz Log FlashQuizViewHistory.asp On the ASP page that displays the quiz log, you use the DW application toolbar’s Recordset component to create a recordset consisting of the data in the Results table. Then you use the DW application toolbar’s Dynamic Table component to display the Recordset in a table onscreen.

10 Creating the Recordset FlashQuizViewHistory.asp

11 Creating the Dynamic Table FlashQuizViewHistory.asp


Download ppt "Flash Database Access Passing Variables to Flash and Storing Flash Interaction Results in an Access Database."

Similar presentations


Ads by Google