private function subscribeEmail():void {
// submit form
var req:URLRequest = new URLRequest( _model.frameworkGateway );
var vars:URLVariables = new URLVariables( );
var proxy:URLLoader = new URLLoader( );
vars.action = "subscribe";
vars.email = _emailField.text;
req.data = vars;
req.method = URLRequestMethod.POST;
proxy.addEventListener( Event.COMPLETE , subscribeComplete );
proxy.addEventListener( IOErrorEvent.IO_ERROR , ioError );
proxy.load( req );
// sendToURL( req)
}
private function subscribeComplete(evt:Event):void {
var content:String = evt.target.data;
var strippedContent:Array = content.split( "res=" );
_errorText.text = strippedContent[1];
}
private function ioError(io:IOErrorEvent):void {
Logger.info( "RESULT: " + io.target.data.res );
_errorText.text = "Could not subscribe";
}
将vars发送到服务器
ActionScript3
阅读 58
收藏 0
点赞 0
评论 0
评论列表
文章目录