Reputation: 300
In a typical as3 or flex project, after loading xml file, i load jpg files (thumbnails etc) manually, so i can use them in sprites / movie clips etc.. currently i am working on air mobile project. and i am attempting to load some thumnails(jpg) file to list view (spark) and using custom item renderer. itemrenderer has an spark image component in it. and its data property is set to Image object. i can check that image files do exists in file application directory. do i need to load all those thumbnails in memory. then use them? image object will autoload source file object?? once assigned? do i have to tell it explicitly to load file object? what events should i use to amke sure , image file object is loaded.?
any ideas? thanks in advance.
Upvotes: 0
Views: 508
Reputation: 6359
Spark images are really easy to work with. All you need is a url.
<s:Image source="http://someimagesite.com/someimage.png" width="100%" height="100%" />
You can also use bitmap data or even embed directly into the source tag.
[Embed(source="image.png")] private var myImage:Class
mySparkImage.source = new myImage() as BitmapData;
<s:Image source="@Embed('image.png')" />
Take a look: http://help.adobe.com/en_US/flex/using/WSc5cd04c102ae3e97-33ad5caa12c719dc7c8-8000.html
Upvotes: 1