0
私はこのような問題があります。Android OSを搭載したデバイスでは、私はアクションスクリプトコードを実行しています。そして私には、いくつかのデータを送信する方法があります。しかし!!!サーバーにデータを送信する前にアプリケーションを停止しても、そのデータは何とか送信されます。私はそれがどのようにすることができるか分からないのですか?誰でもこの問題に直面した?私を助けてください。ありがとう。珍しいコールバックコール
public class VerifyCommand extends SimpleCommand
{
override public function execute(notification:INotification):void
{
//here is the place, where I put breakpoint and stop the program
trace("here is the place, where I put breakpoint and stop the program");
verify();
}
private function verify():void
{
var tempError:Error = new Error();
var stackTrace:String = tempError.getStackTrace();
trace(stackTrace);
var request : URLRequest = new URLRequest();
request.url = "http://www.somesite.com";
request.method = URLRequestMethod.POST;
request.contentType = "application/x-www-form-urlencoded; charset=utf-8";
request.data = variables;
request.useCache = false;
request.cacheResponse = false;
var call_loader:URLLoader = new URLLoader();
call_loader.dataFormat = URLLoaderDataFormat.TEXT;
call_loader.addEventListener(Event.COMPLETE, onVerificationResult);
call_loader.addEventListener(IOErrorEvent.IO_ERROR, onVerificationError);
call_loader.load(request);
}
private function onVerificationResult(event:Event):void
{
trace("all ok");
}
private function onVerificationError(event:Event):void
{
trace("all failed");
}
}