作者openyayak (123)
看板Flash
标题[问题] 关於 URLVariables 与 伺服器端的传递 ?
时间Tue Apr 27 08:58:40 2010
各大大手早安,想要请教一下大家,想要将变数的值传送给伺服器端使用。
以下是我的Code:
var scriptRequest:URLRequest = new URLRequest("
http://202.153.190.234/zone/job
central/10SP/Mammysp/getFlashPost.aspx");
var scriptLoader:URLLoader = new URLLoader();
var scriptVars:URLVariables = new URLVariables();
scriptLoader.addEventListener (Event.COMPLETE, handleLoadSuccessful);
scriptLoader.addEventListener (IOErrorEvent.IO_ERROR, handleLoadError);
scriptVars.var1 = "one";
scriptRequest.method = URLRequestMethod.POST;
scriptRequest.data = scriptVars;
scriptLoader.load (scriptRequest);
function handleLoadSuccessful (e:Event):void
{
trace ("Message sent.");
}
function handleLoadError (e:IOErrorEvent):void
{
trace ("Message failed.");
}
}
不知道我的code有没有将值传出去 ?
是否要使用 navigateToURL 才能传送呢 ?
而传送过去的变数是 scriptVars.var1 ? 还是 scriptVars ?
拜托各位大大解答,谢谢。
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.125.26.94
1F:→ Senkousha:"var1=one"? 04/27 09:47
2F:→ openyayak:想传送"one"这个值 . 04/27 10:27
3F:推 scars:会用POST传 var1 过去,其值= "one" 04/27 12:37