开发者

Handle server response in AS3

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜