Flash Database Access - PowerPoint PPT Presentation

About This Presentation
Title:

Flash Database Access

Description:

Flash Database Access Passing Variables to Flash and Storing Flash Interaction Results in an Access Database Flash Database Access Storing Flash interaction results ... – PowerPoint PPT presentation

Number of Views:80
Avg rating:3.0/5.0
Slides: 12
Provided by: Fred3214
Learn more at: http://www1.udel.edu
Category:

less

Transcript and Presenter's Notes

Title: Flash Database Access


1
Flash Database Access
  • Passing Variables to FlashandStoring 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 UserFlashQuizIdentifyUser.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 CodingFlashQuizAskQuestions.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 users email address in a session
    variable, the ASP code islt Session("email_addr
    ess") Request.Form("email").Item gt
  • To pass this data to the embedded Flash movie
    object, you modify the objects movie parameter
    as followsltparam name"movie"
    value"FlashQuiz.swf?usernamelt
    Session("email_address") gt"gt

5
Posting the Quiz ResultsFlashQuiz.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
    followsreport_btn.onRelease function()
    score (iNumberCorrect / iNumberAsked) 100
    getURL(FlashQuizStoreResults.asp", "_self",
    "POST")

6
Displaying the DataFlashQuizStoreResults.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 lt Request("score") gt for lt
    Request(email_address") gt
  • At runtime, this writes a message in the form
    ofThe result of the quiz was 33 for
    Elvis_at_graceland.com.

7
Storing the Results in the DBFlashQuizStoreResult
s.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 toolbars Command component
    to create the SQL command that will insert the
    data into the database.

8
Configuring the SQL CommandFlashQuizStoreResults.
asp
9
Viewing the Quiz LogFlashQuizViewHistory.asp
  • On the ASP page that displays the quiz log, you
    use the DW application toolbars Recordset
    component to create a recordset consisting of the
    data in the Results table.
  • Then you use the DW application toolbars Dynamic
    Table component to display the Recordset in a
    table onscreen.

10
Creating the RecordsetFlashQuizViewHistory.asp
11
Creating the Dynamic TableFlashQuizViewHistory.as
p
Write a Comment
User Comments (0)
About PowerShow.com