mynam...@gmail.com

unread,

Oct 3, 2007, 12:21:15 PM10/3/07

to Flex India Community

hi

i want to add a progress bar to my flex program, in this program user
enters his details and data is stored in server, i want to add this
progress bar to display me the progress of storing the data in the
server. pls help.

Abdul Qabiz

unread,

Oct 3, 2007, 1:33:00 PM10/3/07

to flex_...@googlegroups.com

If you are using HTTPService, you can start showing progress-bar (indeterminate mode) and on result/fault event you can stop showing the progress bar.

If you want to show the progress-bar in different mode (bytes downloaded and bytes total), you need to use URLLoader and look at progress event,... This works fine, if server is returning loads of data..

If you want to show the progress of server-side progress (data processing, insert/update-db-progress etc), that's a very specific use-case and you would need to write logic to do that... You need to send the progress of (server-side) operations to client and let client show progress (cumulative)..

Does it make sense?

-abdul

smalik

unread,

Oct 3, 2007, 5:50:01 PM10/3/07

to Flex India Community

Just an addition:

Flex (or for that matter any client) cannot know in advance how much
data the server is sending. This can (and does) work fine in case
server is sending a static file because then the "Content-Length"
header is "pre known" and so flex can know how much bytes its gonna
get. But if I am just streaming a huge chunk of data, flex probably
will have no way of knowing what is the "bytesTotal"! And that's the
reason bytesTotal is zero during the progress. The API reveals this:

bytesTotal property
public var bytesTotal:uint = 0

Indicates the total number of bytes in the downloaded data. This
property contains 0 while the load operation is in progress and is
populated when the operation is complete.

There's (potentially) no way of knowing a "percentage" progress until
server computes the result and first sends the client the length of
bytes data. Its not about flex, it is a fundamental weakness of a
client/server model.

Regards,
Sandeep

When we did some testing, we found that generally "bytesTotal"

On Oct 3, 4:33 pm, "Abdul Qabiz" <abdul.qa...@gmail.com> wrote:
> If you are using HTTPService, you can start showing progress-bar
> (indeterminate mode) and on result/fault event you can stop showing the
> progress bar.
>
> If you want to show the progress-bar in different mode (bytes downloaded and
> bytes total), you need to use URLLoader and look at progress event,... This
> works fine, if server is returning loads of data..
>
> If you want to show the progress of server-side progress (data processing,
> insert/update-db-progress etc), that's a very specific use-case and you
> would need to write logic to do that... You need to send the progress of
> (server-side) operations to client and let client show progress
> (cumulative)..
>
> Does it make sense?
>
> -abdul
>

vaibhav pareek

unread,

Oct 4, 2007, 9:04:02 AM10/4/07

to flex_...@googlegroups.com

Thanx a ton.

Reply all

Reply to author

Forward