Just additional information to make everything clear.

In my ActionScript, I have the following:

private var progressBar:ProgressBar;

public function clickHandler(event:MouseEvent):void
{
        image1.source = list.selectedItem.photoUrl;
        progressBar = new ProgressBar();
        progressBar.indeterminate = false;
        progressBar.mode = "polled";
        progressBar.label = "Loaded %3%%";
        progressBar.source = "image1";
        addChild(progressBar);
}

private function completeHandler(event:Event):void 
{
        // remove progress bar
        removeChild(progressBar);
}


My mxml file has the following:

<mx:Image id="image1" width="100%" height="100%" maintainAspectRatio="true" 
complete="completeHandler(event)" />


When the image is being loaded, the progress bar shows progress but when
subsequent images are loaded the progress bar stays at the same state it was
when the first image completely loaded.

How do I reset it?



gabsaga wrote:
> 
> I have tried progressBar.setProgress(0, 100) but it looks like it doesn't
> have any effect. Is it because the mode in my progress bar is set to
> "polled" ? When I change the mode to manual, I don't see any progress. It
> says at 0 all the time.
> 
> 
> 
> 
> Adnan Doric wrote:
>> 
>> progressBar.setProgress( 0, 100 );
>> 
>> --- In [email protected], gabsaga <[EMAIL PROTECTED]> wrote:
>>>
>>> 
>>> I have an application that when you click on a button, it loads an
>> image in a
>>> panel. There is a progress bar that shows progress on the image being
>>> loaded. The progress bar works fine when I load the first image but
>> when I
>>> load subsequent images, it still shows the last status of the first
>> progress
>>> bar. Is there a way to reset a progress bar so that it starts from 0
>> each
>>> time a new image is loaded?
>>> 
>>> Thanks.
>>> 
>>> Gabsaga
>>> -- 
>>> View this message in context:
>> http://www.nabble.com/How-to-Reset-ProgressBar--tp18634463p18634463.html
>>> Sent from the FlexCoders mailing list archive at Nabble.com.
>>>
>> 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-Reset-ProgressBar--tp18634463p18638873.html
Sent from the FlexCoders mailing list archive at Nabble.com.

Reply via email to