I'm having multiple downloads in a swf, downloading external data. Can I limit the download speed of one download thread or prioritize one?
Asked
Active
Viewed 156 times
0
-
I have no documentation saying so, but from my experience (professional AIR dev, developing in Flash for ~5 years), I have to say such functionality is not included in AS3. My guess is you would have to write your own version of `URLStream`/`URLLoader` to achieve this. – Josh Apr 29 '14 at 16:02
-
I think you can "prioritize" one download thread by not starting other downloads until completion or error on the "prioritized" one. – Vesper Apr 29 '14 at 16:07
-
@Vesper While that is true, I don't think that is what is being asked. The asker wants multiple, simultaneous downloads with each being given a priority level and an associated weighted percentage of the available bandwidth (think how most Torrent applications behave). I would say that such functionality is not available in Flash. – Josh Apr 29 '14 at 16:23
-
@Vesper Is exactly what Josh described, ofc is not a torrent client, but sort of – Nertan Lucian Apr 29 '14 at 16:41
1 Answers
0
Flash will download them in the order you ask for them. If you need one first, then ask for that one first.
When running within a browser it is actually the browser that makes the download on behalf of the client container (the client merely requests that the browser does the download). A lot of browsers have restrictions on concurrent file downloads anyway, especially in the same domain, and that is not something you will be able to circumvent with the in-built classes.
My guess is that you could roll your own (or use an existing client as a base) using Socket
instead of URLLoader
. This would be a large amount of work though - the browser does a lot of free work for you (SSL, cookies from the current session, gzip, keep-alives etc).

AndySavage
- 1,729
- 1
- 20
- 34