I need to use the same image multiple times in my project.
The image is loaded at runtime through HTTP request (for some
reason, I have to load it at runtime). To avoid loading it multiple
times, I want to load it once and reuse it as many times a neeeded.
I need to create new Image object but with the same image content.
To be more precise, I load one image at runtime as below:
var img:Image = new Image();
I want to use the same image in different places. Then I
create a new image:
var newImg:Image = new Image();
Now how could I reference to loaded image that I don't need
to do the same thing as the first time to load again from remote
One way to do this is to access the bitmapData of your image,
copy it and the display Bitmap wherever you want. There's probably
a better and easier way to do it though. Doesn't flex have a cache
to manage loaded ressources ?