Methods of Flash communication with asp/php/asp.net 1th/3 page _flash as

Source: Internet
Author: User
First, the use of loadvariables
An example simply describes how to send a request to a server-side ASP via a Get method:
Copy Code code as follows:

_root. Pushaction = function (URL,) {
This.loadvariables (URL, "get");
}
var ask = true;
var pushurl = "http://localhost/test/return.asp?ask=" + ask;
Pushaction (Pushurl);
_root.onenterframe = Fuction () {
Trace (_root.output);
}

Here we first define a function called Pushaction, which uses the get parameter in the Loadvariables function. A Boolean variable called ask is then defined to pass the variable to the server. Finally, the Pushaction function is used to send a GET request to an ASP page named Return on the server. If you need to handle such a request, in ASP, the parse result for the URL row exists in the request object, such as the following example:
Return.asp

[Copy to Clipboard] [ - ] CODE:
<%@ language= "JScript"%>
<%
Declaring and defining variables that accept requests
var str_getask= request.querystring ("ask");
Declaring and defining return information variables
var str_msg = "sorry! Your request tread awry. ";
If the accepted variable is true, a success message is returned
if (Str_getask = = "true") {
str_msg = "ok! Your request Succeed! ";
}
Response.Write ("output=" + str_msg);
%>
Thus, a variable whose name is output and the value is Str_msg is sent back to Flash Player, which can be referenced in Flash by the name of output. Of course we have to be aware that the server takes time to handle this process, so the last Onenterframe is used to test whether any variables are returned.
Current 1/3 page 123 Next read the full text

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.