Search code examples
flex4httpservice

Flex 4 - Pass data sent by HTTPService object to result handler


I have a data object that gets sent as a POST request by an HTTPService object, but I want to be able to access the data object in the result handler. What is the best way to do this?


Solution

  • var token:AsyncToken = httpService.send();
    token.yourPropertyName = yourObject;
    

    AsyncToken is a dynamic object so you can add properties at runtime. Then, in your result handler, you acces the token with :

    event.token.yourPropertyName