I have a situation where I'm loading some content using a URLLoader but the content could either be a video (flv or swf) an image(jpg or png or gif) or a swf. The trick is, I need to react in different ways based on the type of content that's loaded without necessarily knowing what type of content it is beforehand.
I currently have concocted an elaborate solution (and by elaborate I mean a confusing series of if statements and try...catch blocks) involving trying to either load it into a control and catching the errors (for example: I'll create a Image instance, add an event listener for the ioError event and it's recieved I assume it's not an image or a swf...) but it kinda seems like a hack.
Is there any clean way to determine the type of loaded content from a URLLoader?