Pass flash value to ASP page

Source: Internet
Author: User
1. loadvars Load Method
-----
In flash, write one and pull out two dynamic file boxes. The variables are myname and mypsd. Pull out a component button named submit_button for submission and then pull out a textarea component, returns information about an ASP file. See:

Write in the first frame
Submit_button.onrelease = function (){
VaR passvar: loadvars = new loadvars ();
VaR local_url: String = "" // used for debugging, such as http: // localhost /... because I use netbox as the server, the generated FLASH file can be placed in the wwwroot directory.
VaR allstr: String = "name =" + myname + "& PSD =" + mypsd;
Passvar. onload = function (SUCCESS ){
If (SUCCESS ){
Reval. Text = this.info; // once the load is successful, the escape character returned by ASP becomes the attribute value of the object.
Trace ("loaded successfully! ");
}
Else {
Trace ("an error occurred! ");
}
}
Passvar. Load (local_url + "getvar. asp? "+ Allstr );
}
As ends now, write ASP files now
Getvar. asp
<%
Dim name, PSD
Name = request ("name ")
PSD = request ("PSD ")
If name = "51js" and PSD = "51js" then
Response. Write "info = welcome" & name &"! "
Else
Response. Write "info = check your username" & name & "or password! "
End if
%>
Okay. Enter the flash path!
There are ready-made examples upstairs. Let's take a look. For the ASP debugging environment. Download
Http://pallove.zj.com/netbox/netbox.rar
Note: Put Flash files and ASP files under wwwroot, then your local_url can be written as "http: // localhost/". In this way, in flash, you can directly debug it without having to open a browser. Haha
Alas, I am not very familiar with the syntax of as2.0. After all, for example, JS, 2.0, some C # and Java.
No problem now. Repair and make up.

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.