Read variables from ASP files:
For ASP files, I am not going to give a detailed introduction here. I will only talk about the content that involves FLASH reading.
. First, we will introduce a built-in ASP object: response. This object is used from the server to the client
Transfer information. Response. Write is the method of output information. The object is another Server.
The Server. URLEncode method uses the string in ASP as the URL format to encode it as the target string,
This is exactly the format that FLASH can accept. Well, the following details:
1. Compile an ASP file. (The specific content depends on the function)
2. Statements output to the client in ASP file settings. For example:
<% M0 = "OK"
Response. write ("m1 =" + Server. URLEncode (m0) %>
("M1 =" + Server. URLEncode (m0) is to ensure that the output variable format is:
Variable name = variable value. This is the most important thing; otherwise, the acceptance will fail.
When multiple variables are output to the SWF file, use & join for example:
Response. write ("m1 =" + Server. URLEncode (m1 ))
Response. write ("& m2 =" + Server. URLEncode (m4 ))
3. Set text fields in the SWF file. This is the same as the methods and key points described in (1) (2) above.
Same. In this example, the text field name in the SWF file is m1.
4. Set Actions on the Key Frame
Double-click the key frame. The Actions setting box is displayed,
Click "+" and Load/Unload Movie.
Select "Load Variables Into Location"
Enter the URL and file name of your ASP in the URL input box.
(For example, http: // ***. ***. ******. ***/js. asp). select Target.
Finally, select Send using GET in Variables.
All Actions are as follows:
Load Variables ("http: // ***. ***/js. asp", "", vars = GET)
Because ASP files run on the server, you must add the server before the file name
Address.
5. Ensure that the file is connected to the server and runs the swf html file. The value of m1 is "OK"
Display in the SWF file.
(4) Send variables to ASP files:
This is 3) the opposite process. First, we will introduce an ASP built-in object: The ASP object Request.
Is used to obtain information from the client. The Request. form table method is to obtain the form letter from the client.
Request ("REMOTE_ADDR", add the REMOTE_ADDR parameter to obtain the IP address of the client.
...... These are no longer FLASH-related content, so stop it and answer the question:
1. Set the read client form statement in the ASP file: m3 = Request. form ("input"
2. Set text fields in the SWF file and define them as editable input fields. (Shouldn't it
Right ?), Set a text field to accept the variable processed by ASP.
It is different from (2. Note that the text field name must be consistent with the variable name accepted in the ASP file.
In this example, "input" is used.
3. Set a button in SWF and a script command on the button Actions. (Equivalent to HTML
Send button, always let FLASH know when to send)
Double-click the button and select Actions. The Actions setting box is displayed,
Click "+" and Load/Unload Movie.
Select "Load Variables Into Location"
Enter the URL and file name of your ASP in the URL input box.
(For example, http: // ***. ***. ******. ***/js. asp). select Target.
Finally, select Send using POST in Variables.
(Form transmission is POST transmission)
All Actions are as follows:
Load Variables ("http: // *****. *****/js. asp", "", vars = POST)
4. Ensure that the file is connected to the server and run the SWF file, run the swf html file, and display
Enter a few words in the input box and click the send button. You can see that the variable value you entered passes through ASP and
.
So far, you have mastered the interface points of ASP files and FLASH files. In fact, FLASH
The basic interface technologies of message books, counters, and chat rooms are not the same.