8/5/2010 1:36:51 AM
Title:
Image loader- progress bar
hi all,
in my application i am allowing to upload there images,while uploading i want to show a image and once the image is uploaded my pre-defined image should dissapear and the uploaded image should display.
please provide with the sample code/eg
thank u
8/5/2010 1:58:22 AM
place two image components , In one image component display the loaded image and in the other one embed the image that you want to show temporarily.
Initially hide the temp image.
On starting upload set the temp image visibility to true, and hide the upload image component and on the complete event of the uplodImage container set the temp image visibility to false
8/5/2010 4:49:26 AM
Thanks Ronald,
it didn't work,actually i want to show a progress bar when the user image is uploading.
any idea about this,
thanks
Davis
Points: 780
Posts:0
8/5/2010 5:16:30 AM
use the progress event in the image loader to get the progress of data loaded and you can show the progressbar using that data
8/5/2010 5:31:02 AM
simplest way to show progressbar on an image loading is to use the flex inbuilt progressbar control. Its quite easy to use see this example in flex with actionscript 3.0
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
public function showImage():void {
//load image into image component
imageCom.load('myimage.JPG');
}
]]>
</mx:Script>
<mx:VBox width="600" height="600">
<mx:Canvas>
<mx:ProgressBar width="200" source="imageCom"/>
</mx:Canvas>
<mx:Button id="myButton" label="Show Image" click="showImage();" />
<mx:Image id="imageCom" height="500" width="600" autoLoad="false" visible="true" />
</mx:VBox>
</mx:Application>