The code copy is as follows:
Can I pass variables to asp in flash animation?
faq-it.org/vb/---------------------------------------------------------------
Database structure:
The first step is to create a database. In the example, use the Access database, the table name is tblStaff
There are three fields: strID (auto-number), strKnownAs(Text), strSurname(Text).
This is a database used to demonstrate usernames, add some data.
The second step is to create a Flash4 animation:
The steps are as follows:
1) Create three textfields. They are used to display data.
2) Set the name of the first textfield to Input, it is used to receive input data
3) The other two textfields are named KnownAs and Surname respectively
4) Other settings are the default first
5) Finally, select the Flash library to add a button (it should be a reusable component ScrollBarButton).
This is an important step, the button will pass the input variable to the ASP page
Click the Action page on the Properties of the button. Click the "+" sign and OnMouseEvent. Tick the Release box.
6) Click the "+" sign and Load/UnloadMovie again. Select "LoadVariablesIntoLocation"
Enter your ASP file name (for example flash.asp) in the URL input box. Select Target.
7) Finally, select SendusingPOST in Variables. Click the "+" sign to set the variable
Enter "Input" in the Variable input box (that is the name of the first textfield)
When all the above work is completed, you should see the following content in actionbox:
On(Release)
LoadVariables("flash.asp","",vars=POST)
SetVariable:"Input"=""
EndOn
In this way, when this button is clicked and released during the animation process, the contents in the Input input box will be passed to the flash.asp file.
Note that form uses the post method to pass variables.
8) Now create an HTML page that contains the Flash animation file
Step 3: Code of ASP file
<%
SetConnection=Server.CreateObject("ADODB.Connection")
SetRecordset=Server.CreateObject("ADODB.Recordset")
Connection.Open"people"' DSN for your database connection
SQL="SELECT*FROMtblStaffWHEREstrID="&Request.Form("Input")&";"