Use ASP technology in Flash

xiaoxiao2021-03-06  18

Database Structure: Step 1: Establish a database. In the example, use the Access database, table names TBLstaff, three fields: strike, strKnownas (text), strsurname (text). This is a database that demonstrates usernames, just add some data.

Step 2: Create an animation of a Flash 4: Steps: 1) Establish three Text Field, which is used to display data. 2) Set the first Text Field's Name to INPUT, which is used to receive input data. 3) The other two Text Field are named KNOWNAS and Surname, respectively. 4) Other settings are default. 5) Finally, choose to add a button from flash's library (it should be a reusable component scrollbarbutton). This is a very important step, the button will pass the input variables to the ASP page to the property (Properties) on the Properties, click " " and ON MouseEvent, and hook the release box. 6) Click " " and Load / Unload Movie, select "Load Variables INTO LOCATION", enter your ASP file name (such as flash.asp) in the URL input box, select Target. 7) Finally, select Send using POST in Variables, click the " " to set the variable. Enter "INPUT" in the Variable input box (the first Text Field's Name) When the above work is completed, you should see the following in the action box: on (Release) Load Variables ("Flash.asp" , "", vars = post) SET VARIABLE: "INPUT" = "" END ON This will be passed to the flash.asp file when this button is clicked and released during the animation. Note that Form is transferred in the POST mode. 8) Now establish an HTML page where this Flash animation file is included.

Step 3: ASP file code <% set connection = server.createObject ("adodb.connection" set recordset = Server.createObject ("adoDb.recordset") Connection.Open "people" 'Your database connection DSN SQL = "Select * from tblstaff where strid =" & Request.form ("INPUT") & ";" Recordset.open SQL, Connection, 1, 2 if Recordset.eof kilnownload = "not" Surname = "Found" Else Knownas = Recordset ( "strKnownAs") Surname = Recordset ( "strSurname") End If Recordset.Close Connection.Close response.write ( "KnownAs =" Server.URLEncode (KnownAs)) response.write ( "& Surname =" Server. Urlencode (Surname))%> Need to note that the write method of passing the KNOWNAS and Surname will be: knownas = data1 & file = data2 Use server.urlencode (variablename) to ensure that the past variable is encoded in the URL format . Let's take a brief introduction to the principles of ASP and Flash communication: Variables are actually passed to flash through the URL. In fact, this is a GET method. You don't use the ASP. You can also pass the variable to a SWF file, as long as this: < Param name = movie value = "mymovie.swf? Myvariable = text of my variable">

The text "Text of My Variable" will appear in the image specified in the movie of Flash, and then use the animation feature in Flash to make a strong web page. The easiest is to use the Flash combined with the database to draw a very beautiful Pie.

转载请注明原文地址:https://www.9cbs.com/read-42098.html

New Post(0)