Stupid Image Preloader [Flex]

I was trying to create a simple preloader for my image gallery in Flex; so i ended up with something like this:

[code lang="XML"]
<mx:Image progress="pre.visible=true" complete="pre.visible=false" source="img.png"
height="40" width="40" />
<mx:Image id="pre" source="@Embed(source='preloader.swf')" height="40" width="40" />
[/code]

we simply use the events progress and complete of the image loading to show or not our coustom preloader pre. Note that the preloader code is placed after the one of the image, thus it will appear above the image.

This is just the solution i adopted, if you are looking for something more professional please have look to this tutorial.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Home
Twitter Facebook Flickr Vimeo About me Email me