作者fake01 (ya da)
看板Flash
标题[问题] flash cs5 传值 jsp
时间Tue Mar 1 02:42:17 2011
小弟新手,想请问强者一个简单的问题。
用相同的as3、jsp程式码,可以用在flash cs3发布的.exe档,但是却不能用在cs5发布
的.exe档。
我要输入帐号密码,然後比对资料库的资料是否相同,可是好像jsp都收不到值
到底是出了甚麽问题?
stop();
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLLoaderDataFormat;
import flash.net.URLVariables;
import flash.events.Event;
import flash.events.HTTPStatusEvent;
import flash.events.IOErrorEvent;
import flash.events.ProgressEvent;
import flash.events.SecurityErrorEvent;
go_btn.addEventListener(MouseEvent.MOUSE_DOWN,goin);
function goin(event:MouseEvent) {
var myRequest:URLRequest = new URLRequest("
http://localhost:8080/login.jsp");
var myLoader:URLLoader = new URLLoader();
var myVariables:URLVariables = new URLVariables();
myLoader.addEventListener(Event.COMPLETE, loadSuccessful);
myLoader.addEventListener(IOErrorEvent.IO_ERROR, loadError);
myVariables.var3 = id_txt.text;
myVariables.var4 = psw_txt.text;
myRequest.method = URLRequestMethod.POST;
myRequest.data = myVariables;
myLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
myLoader.load(myRequest);
function loadError(evt:IOErrorEvent):void {
trace("传送失败");
}
function loadSuccessful(evt:Event):void {
if(myLoader.data.a==1)
{
gotoAndStop("2");
}
else
gotoAndStop("3");
}
}
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.58.187.192