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.