1)swf從jsp讀數(shù)據(jù)
a) 在flash中建一個(gè)動(dòng)態(tài)文本框,一個(gè)button;文本框名字叫str,button上寫(xiě)
on (release) {
loadVariable("http://localhost:8080/demo/sentVar.jsp", "","get");
}//url相對(duì),絕對(duì)路徑好像都可以
b) 在sentVar.jsp中寫(xiě)如下代碼:
<%@ page contentType="text/html;charset=gb2312"%>
<%
String tmp="wowowo";
out.println("&str="+tmp);//這里一定要寫(xiě)成"&str="的形式,&一定不能少,str的名字要與你a中建的相同,“= ”號(hào)也不能少;
%>
c)測(cè)試。click button ...yeah~(failed?its none of my business)
try again~~
-------------------------------------------------------------------
2)swf向jsp寫(xiě)數(shù)據(jù)
這個(gè)簡(jiǎn)單點(diǎn)。
c建一input textfield,起個(gè)名字str吧。一個(gè)button,上面寫(xiě):
on (release) {
getURL("showrs.jsp", "","get");
}
b)showrs.jsp中寫(xiě):
<%@ page contentType="text/html;charset=gb2312"%>
<%
String tem=request.getParameter("str");
out.println("str="+tem);
%>
everything is ok~enjoy...
引自:http://www.flashempire.net/showpost.php?p=892409
a) 在flash中建一個(gè)動(dòng)態(tài)文本框,一個(gè)button;文本框名字叫str,button上寫(xiě)
on (release) {
loadVariable("http://localhost:8080/demo/sentVar.jsp", "","get");
}//url相對(duì),絕對(duì)路徑好像都可以
b) 在sentVar.jsp中寫(xiě)如下代碼:
<%@ page contentType="text/html;charset=gb2312"%>
<%
String tmp="wowowo";
out.println("&str="+tmp);//這里一定要寫(xiě)成"&str="的形式,&一定不能少,str的名字要與你a中建的相同,“= ”號(hào)也不能少;
%>
c)測(cè)試。click button ...yeah~(failed?its none of my business)

-------------------------------------------------------------------
2)swf向jsp寫(xiě)數(shù)據(jù)
這個(gè)簡(jiǎn)單點(diǎn)。
c建一input textfield,起個(gè)名字str吧。一個(gè)button,上面寫(xiě):
on (release) {
getURL("showrs.jsp", "","get");
}
b)showrs.jsp中寫(xiě):
<%@ page contentType="text/html;charset=gb2312"%>
<%
String tem=request.getParameter("str");
out.println("str="+tem);
%>
everything is ok~enjoy...
引自:http://www.flashempire.net/showpost.php?p=892409