In Flash Actionscript 3, when you need to load text, you use a class called 'URLLoader', and when you need to load an image (or .swf) you use a class called 'Loader.' As far as I know, loading a .bmp with URLLoader is as useless as loading an .xml into a Loader - it doesn't compute.
I'm making a class that handles a queue of external assets to be loaded - but aside from splitting the target url to check out the file extension, I can't figure out a good way to tell if each URL requires a URLLoader or a Loader. At any rate, it's imaginable that a .php url might return either an image or a document - so there's no way to count on the file names to dictate the right type of loader class to use.
Any ideas on how to reliably detect the right class for the job on a URL-by-URL basis?