将vars发送到服务器

ActionScript3
阅读 58 收藏 0 点赞 0 评论 0

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";
}
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号