A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: HTTPService error handling question

  1. #1
    Member
    Join Date
    Jun 2006
    Location
    Croatia
    Posts
    90

    HTTPService error handling question

    When i am using HTTPService for Flex-PHP communication i set HTTPService's 'fault' property which handles error event. So basically if i have HTTPService set up like this:

    Code:
    <mx:HTTPService id="test" url="http://localhost/test/test.php" contentType="application/xml" useProxy="false" method="POST" fault="httpServiceError(event)">
    </mx:HTTPService>
    Then 'httpServiceError' method is fired in case of HTTPService error. What i would like to do in httpServiceError method is trace the id of the failed HTTPService. I tried with:

    Code:
    public function httpServiceError(evt:FaultEvent):void{
    trace(evt.currentTarget.id);
    }
    But soon realized that 'FaultEvent' doesn't conatin 'currentTarget' property so this failed. What's the correct way to find out 'id' of the failed HTTPService?

    thanks in advance,
    best regards

  2. #2
    Member
    Join Date
    Jun 2006
    Location
    Croatia
    Posts
    90
    I solved this problem by passing an additional argument to event listener which i used for identification of target HTTPService.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center