Anon21
Anon21

Reputation: 3073

Using Flash peer to peer to share files. How to display a progress bar to the downloading client?

I am trying to implement the actionscript program described at this address. http://cookbooks.adobe.com/post_Create_a_P2P_file_sharing_application-16539.html. It lets two flash client connect to the cirrus service and share a file using the flash peer to peer facilities.

The problem is that I would like to display a progress bar to the downloading client for long files. There does not seem to be any progress-type event been triggered by data sent by NetStream.Send. This particular function appears to have been created by adobe to send tiny update and meta-data code.

Is there a way to display a progress bar of downloaded data when using a netstream object?

The alternative would be to break the data into small packets and send them individually; then increment the progress bar as they are received by the client. Unfortunately this creates a lot of overhead for the simple problem of displaying a progress bar.

Upvotes: 1

Views: 1360

Answers (2)

Tom
Tom

Reputation: 8180

You are right, breaking the data into chunks is the way to go to create a progress bar.

Upvotes: 1

Günsche
Günsche

Reputation: 11

if you still need this, check out the object replication feature of the Cocoon P2P project which gives you all you need including progress events:

http://code.google.com/p/cocoon-p2p/

http://code.google.com/p/cocoon-p2p/wiki/ObjectReplication

Upvotes: 1

Related Questions