Sunday, 8 May 2011

Flex: how to make a image cache? (easier way) - REFdn4007673813


situation

how to make a image cache?
problem

adobe flex4 AS3.0 the image component
how to load images save them to cache…
and how apply them to Image components
---
> page by dn
difficulty level

9/10 :(
solution

In order to make a cashe of the photos/images, I do the follow simple way:
- With URLLoader I download the data… the "Complete" event gives me the "data" property… in this property the data of the image is in binary format (don't be afraid). I save this "data" to another variable (or array) of Object type. For this example, I named this variable "downloadData" you will see bellow.
- In order to load the data on a visual component Image, I do the follow code:
myImage.data=downloadData;
attention

no attentions!

No comments:

Post a Comment