Load images in the background using Flex

actionscript-3apache-flex

In my Flex application I call a web service that returns a few dozen "items" where each item has an associated image url. I create a model based on this data and bind the image components source property to the url string.

I'd like to have more control over the loading of these images, particularly the order in which they are loaded. I'd also like to preload images that aren't necessarily bound to components yet. Essentially I'd like to load the images the user will see first, then load images in the background that they may see later.

Is there a mechanism in Flex I can utilize to load images in the background?

Best Answer

Put the files in a queue and load them one after each other. Flex (the framework) won't do this for you but you can relatively easily write your own in AS3.

Personally i use my own solution for this but there's a bunch of available existing solutions for this too; the most common probably being Bulk Loader.