使用Flash点对点共享文件。如何向下载客户端显示进度条?
我正在尝试实现此地址中描述的动作脚本程序。 http://cookbooks.adobe.com/post_Create_a_P2P_file_sharing_application-16539.html。它允许两个闪存客户端连接到 cirrus 服务并使用闪存对等设施共享文件。
问题是我想向下载客户端显示长文件的进度条。 NetStream.Send 发送的数据似乎没有触发任何进度类型事件。这个特定的函数似乎是由 adobe 创建的,用于发送微小的更新和元数据代码。
使用 netstream 对象时有没有办法显示下载数据的进度条?
另一种方法是将数据分成小数据包并单独发送;然后在客户端收到进度条时增加进度条。不幸的是,这对于显示进度条这个简单问题来说会产生大量开销。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您仍然需要此功能,请查看 Cocoon P2P 项目的对象复制功能,它为您提供了所需的一切,包括进度事件:
http://code.google.com/p/cocoon-p2p/
http://code.google.com/p/cocoon-p2p/wiki/ObjectReplication
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
你是对的,将数据分成块是创建进度条的方法。
You are right, breaking the data into chunks is the way to go to create a progress bar.