开发者

Handle server response in AS3

开发者 https://www.devze.com 2022-12-22 21:59 出处:网络
I have an asp page that loads a response \" user=exists \" everytime I try to update a database record (when of course the record already exists!)

I have an asp page that loads a response " user=exists " everytime I try to update a database record (when of course the record already exists!) How can I handle this resp开发者_如何学Conse with AS3 in Flash?


assuming you are using a URLLoader...

// Create a URLLoader to handle sending and loading 
loader = new URLLoader();

// add listeners
if (!loader.hasEventListener( Event.COMPLETE)) {
    loader.addEventListener( Event.COMPLETE, handleResponse);
}

// send the data to the URL
loader.load(request);

and then the handleResponse function

private function handleResponse(e:Event):void{
    trace("Returned : " + new String(e.target.data));
}

e.target.data being the response,

hope this helps

0

精彩评论

暂无评论...
验证码 换一张
取 消