I need to create a gallery to load images and display them. This part is fine:
/**
* @variable image_name to store the name of the selected item
*/
private function showimage(evt:Event):void
{
// to store the name of the selected image
var image_name : String = evt.currentTarget.selectedItem.img_name;
// checks if any item is clicked
try
{
if(image_name == "")
{
throw new Error("No image selected from the list");
}
// supplying the image source for the Image imgmain
// also supplying the height and width for the image source
imgMain.source = siteurl + image_name.toString();
}
catch(err:Error)
{
Alert.show(err.message);
}
}
where imgMain is the id the image component.
But, I need a small twist. A transition image i.e. loading image should be displayed while the the image is being loaded. Plz help me out.