just a stab, try progressBar.setProgress( 0, 100 ); maybe? oh, maybe you
need to use source="{image1}". Sorry for the stabs, have not tried this
before. If these don't work, I'd prolly be digging in the source to
ProgressBar to see how it ticks.
DK
On Thu, Jul 24, 2008 at 5:31 PM, Gabsaga Tata <[EMAIL PROTECTED]> wrote:
> I am new to flex and I have developed this very simple application with
> the source could included below.
>
> The problem I'm having is how to reset the progress bar. When the first
> image is loaded in the Featured Photograph panel, the progress bar shows the
> % complete as the image is being loaded. So far, so good.
>
> But when the subsequent images are loaded, the progress bar does not
> change. It just shows the last state after the first image completely
> loaded.
>
> Is there a way to make it such that the progress bar shows the progress of
> subsequent images being loaded?
>
> Thanks for any help in advance!!
>
> Gabsaga
>
>
> ******************** Source Code ********************
>
>
> <?xml version="1.0" ?>
>
> <mx:Application xmlns="*" xmlns:mx="http://www.adobe.com/2006/mxml"
> layout="vertical">
>
>
>
> <mx:Style>
>
> Panel {
>
> backgroundAlpha: 1;
>
> borderAlpha: 1;
>
> headerColors: #c7c7c7, #ffffff;
>
> footerColors: #ffffff, #c7c7c7;
>
> paddingTop: 15;
>
> paddingRight: 25;
>
> paddingLeft: 25;
>
> paddingBottom: 15;
>
> shadowDirection: "right";
>
> }
>
> .header {
>
> color: #ffffff;
>
> fontSize: 15;
>
> fontWeight: "bold";
>
> }
>
> </mx:Style>
>
>
>
> <mx:Script>
>
> <![CDATA[
>
>
>
> import mx.rpc.events.ResultEvent;
>
> import mx.rpc.events.FaultEvent;
>
> import mx.utils.ObjectUtil;
>
> import mx.controls.Alert;
>
> import mx.utils.StringUtil;
>
>
>
> private function resultHandler(event:ResultEvent):void
>
> {
>
> //used for debugging - shows details about result
>
> //returned by the Java class method
>
>
>
> //Alert.show( ObjectUtil.toString(event.result) );
>
> }
>
>
>
> private function faultHandler(event:FaultEvent):void
>
> {
>
> Alert.show( ObjectUtil.toString(event.fault) );
>
> }
>
>
>
> private function updateHandler(event:Event):void
>
> {
>
> remoteObj.updatePhoto(updatedPhoto);
>
> remoteObj.getPhotos();
>
> }
>
>
>
> public function clickHandler(event:MouseEvent):void
>
> {
>
> image1.source = list.selectedItem.photoUrl;
>
> photoLoadProgressBar.visible = true;
>
> progressHandler(event);
>
> }
>
>
>
> private function completeHandler(event:Event):void
>
> {
>
> // make progress bar invisible
>
> photoLoadProgressBar.visible = false;
>
> }
>
>
>
> public function progressHandler(event:Event):void
>
> {
>
> photoLoadProgressBar.indeterminate=false;
>
> }
>
>
>
> ]]>
>
> </mx:Script>
>
>
>
> <mx:RemoteObject id="remoteObj" destination="photosvc"
> result="resultHandler(event)" fault="faultHandler(event)" />
>
>
>
> <Photo id="updatedPhoto"
>
> photoId="{list.selectedItem.photoId}"
>
> photoUrl="{list.selectedItem.photoUrl}"
>
> photoDescription="{txtPhotoDescription.text}" />
>
>
>
> <mx:VBox verticalGap="10">
>
>
>
> <mx:Panel id="gridpanel" title="Simpaq Inc. (Flex Rocks!!)" width="800"
> height="350">
>
>
>
> <mx:DataGrid id="list" dataProvider="{remoteObj.getPhotos.lastResult}"
> width="100%" height="80%" click="clickHandler(event)" >
>
> <mx:columns>
>
> <mx:DataGridColumn dataField="photoId" headerText="Photo ID" width="100" />
>
> <mx:DataGridColumn dataField="photoDescription" headerText="Photo Comments"
> width="300" />
>
> <mx:DataGridColumn dataField="photoUrl" headerText="Photo URL" width="400"
> />
>
> </mx:columns>
>
> </mx:DataGrid>
>
>
>
> <mx:Form width="100%">
>
>
>
> <mx:FormItem label="Comments" width="100%">
>
> <mx:TextArea id="txtPhotoDescription"
> text="{list.selectedItem.photoDescription}" width="100%" height="20%"/>
>
> </mx:FormItem>
>
>
>
> </mx:Form>
>
>
>
> <mx:ProgressBar id="photoLoadProgressBar" width="300" source="image1"
> mode="polled" visible="false" label="Loaded %3%%" labelWidth="400"
> labelPlacement="top" />
>
>
>
> <mx:ControlBar>
>
> <mx:Button label="Get Photos" click="remoteObj.getPhotos()" /> <mx:Button
> label="Update comments" click="updateHandler(event);"/>
>
> </mx:ControlBar>
>
>
>
> </mx:Panel>
>
>
>
> <mx:Panel id="photopanel" title="Featured Photograph" width="800"
> height="400">
>
>
>
> <mx:Image id="image1" width="100%" height="100%" maintainAspectRatio="true"
> complete="completeHandler(event)" />
>
>
>
> </mx:Panel>
>
>
>
> </mx:VBox>
>
>
>
> </mx:Application>
>
> -------------------------------------------------------------
> To unsubscribe from this list, simply email the list with unsubscribe in
> the subject line
>
> For more info, see http://www.affug.com
> Archive @ http://www.mail-archive.com/discussion%40affug.com/
> List hosted by FusionLink <http://www.fusionlink.com/>
> -------------------------------------------------------------
--
Douglas Knudsen
http://www.cubicleman.com
this is my signature, like it?
-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in the
subject line
For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------