When I upload a file using a Flex application, what is the difference between complete and uploadcompletedata events? In which cases one of them will be dispatched and the other one won't?
views:
434answers:
1From the docs:
uploadCompleteData:
Dispatched after data is received from the server after a successful upload. This event is not dispatched if data is not returned from the server.
complete:
Dispatched when download is complete or when upload generates an HTTP status code of 200. For file download, this event is dispatched when Flash Player or Adobe AIR finishes downloading the entire file to disk. For file upload, this event is dispatched after the Flash Player or Adobe AIR receives an HTTP status code of 200 from the server receiving the transmission.
So, if you're uploading a file and not expecting any kind of response from the server you can just use complete. However, if you're expecting the server to return data to you in the upload's response then you need to wait for uploadCompleteData.