1)swf从jsp读数据
a) 在flash中建一个动态文本框,一个button;文本框名字叫str,button上写
on (release) {
loadVariable("http://localhost:8080/demo/sentVar.jsp", "","get");
}//url相对,绝对路径好像都可以
b) 在sentVar.jsp中写如下代码:
<%@ page contentType="text/html;charset=gb2312"%>
<%
String tmp="wowowo";
out.println("&str="+tmp);//这里一定要写成"&str="的形式,&一定不能少,str的名字要与你a中建的相同,“= ”号也不能少;
%>
c)测试。click button ...yeah~(failed?its none of my business)
try again~~
-------------------------------------------------------------------
2)swf向jsp写数据
这个简单点。
c建一input textfield,起个名字str吧。一个button,上面写:
on (release) {
getURL("showrs.jsp", "","get");
}
b)showrs.jsp中写:
<%@ 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中建一个动态文本框,一个button;文本框名字叫str,button上写
on (release) {
loadVariable("http://localhost:8080/demo/sentVar.jsp", "","get");
}//url相对,绝对路径好像都可以
b) 在sentVar.jsp中写如下代码:
<%@ page contentType="text/html;charset=gb2312"%>
<%
String tmp="wowowo";
out.println("&str="+tmp);//这里一定要写成"&str="的形式,&一定不能少,str的名字要与你a中建的相同,“= ”号也不能少;
%>
c)测试。click button ...yeah~(failed?its none of my business)
![Big Grin](http://www.flashempire.net/images/smilies/biggrin.gif)
-------------------------------------------------------------------
2)swf向jsp写数据
这个简单点。
c建一input textfield,起个名字str吧。一个button,上面写:
on (release) {
getURL("showrs.jsp", "","get");
}
b)showrs.jsp中写:
<%@ 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