When loading images using Loader, what's the preferred way to add the image to the display list? Grabbing the data in an Event.COMPLETE handler like new Bitmap( Bitmap(LoaderInfo(e.target).content).bitmapData ) , or adding the Loader instance itself?
It is better to wait for the Loader
to complete and set the Image
data in the result handler.
If you only want to display the Loader's content, then feel free to add the Loader to the display list rather than extracting its contents. It's an uncommon situation when you'll need to reparent a Loader's content.
Additionally, it's worth noting that a Loader's content will not always be accessible. For instance, Flash Player places security restrictions on content loaded from other domains. When these stronger security rules are enforced, Flash Player throws security errors at runtime if you try to access the Loader's content.
Bitmap supports image smoothing when resizing and that's handy sometimes. On the other hand, Loader is DisplayObjectContainer and allows adding other children inside.
Loader is handy as it makes data handling quite neat (loading/unloading). Personally I'd need to have a good reason to extract data from a loader object.
In the case of an image a good reason would be that whatever your doing with the data reqires the BitmapData class.
If you are simply displaying the image then you wont necessaraly need the BitmapData class. In this case working with BitmapData is alota code ya dont need!