Flash CS3 and ASP background data interaction code

Source: Internet
Author: User

The ASP tutorials are written and need to be tested in an IIS environment. In the IED environment, the hard whole is definitely no effect (bring the backstage to direct dry friend point more, haha, so in advance to say.) )

ASP code

Code:

<% @language = "vbscrīpt" codepage= "65001"%>
<%
Dim A,b,ans
A=cint (Request.Form ("a"))
B=cint (Request.Form ("B"))
Ans=a+b
Response.Write ("<?xml version=" "1.0" "encoding=" "Utf-8" "?>")
Response.ContentType = "Text/xml"
Response.Write ("<math>")
Response.Write ("<a>" &a& "</a>")
Response.Write ("<b>" &b& "</b>")
Response.Write ("<ans>" &ans& "</ans>")
Response.Write ("</math>")
Response.End ()
%>

Flash code

Code:

----------------------URLRequest--------------------
var send_urlrequest:urlrequest =new urlrequest ();
Send_urlrequest.url= "flash023.asp";
Send_urlrequest.method=urlrequestmethod.post;
----------------------Data Carrier---------------------
var data_urlvariables:urlvariables =new Urlvariables;
Data_urlvariables["a"]=26;
data_urlvariables["B"]=100;
Send_urlrequest.data=data_urlvariables;
-----------------------XML------------------------
var load_xml:xml;
----------------------Urlloader--------------------
var handler_loader:urlloader =new Urlloader;
Handler_loader.addeventlistener (Event.complete, Onloadcompletehandler);
function Onloadcompletehandler (_evt:event): void {
Load_xml=xml (_evt.target.data);
Show_txt.text =load_xml;
Show_txt.appendtext ("The Return of which is:" +load_xml.ans);
}
try {
Handler_loader.load (send_urlrequest);
} catch (_err:error) {
Trace (_err);
}
--------------------Create a TextField for display----------------
var Show_txt:textfield =new TextField;
Show_txt.multiline =show_txt.wordwrap =true;
Show_txt.width =show_txt.height = 400;
show_txt.x=75;
Addchild (Show_txt);

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.