Interaction between flash and JSP

Source: Internet
Author: User
1) SWF reads data from JSP
A)Create a dynamic text box and a button in flash. The text box is named STR and written on the button.


On (release ){
Loadvariable ("http: // localhost: 8080/demo/sentvar. jsp", "", "get ");
} // Relative URLs. It seems that all absolute paths are acceptable.

B)Write the following code in sentvar. jsp:
<% @ Page contenttype = "text/html; charset = gb2312" %>
<%
String TMP = "wowowo ";
Out. println ("& STR =" + TMP); // It must be written in the "& STR =" format, the STR name must be the same as the one you created in a, and the "=" number cannot be less;
%>
C)Test. Click button... yeah ~ (Failed? Its none of my business) Try again ~~

-------------------------------------------------------------------

2) SWF writes data to JSP
This is simple.

C. Create an input textfield. Set it to Str. A button, written above:
On (release ){
Geturl ("showrs. jsp", "", "get ");
}

B)Write in showrs. jsp:

<% @ Page contenttype = "text/html; charset = gb2312" %>
<%
String TEM = request. getparameter ("str ");
Out. println ("str =" + TEM );
%>
Everything is OK ~ Enjoy...

Lead: http://www.flashempire.net/showpost.php? P = 892409

Related Article

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.