Skip to main content
Inspiring
April 25, 2014
Question

How do upload progress

  • April 25, 2014
  • 1 reply
  • 902 views

How to upload a ByteArray and show progress?


Note: not the progress of the response from the server but sending the ByteArray.

Note: Adobe Flash CS5 (my project is "web")

I'm converting a MovieClip with jpegencoder (bytearray) to sent to a server with "URLLoader", the problem is that the progress of the URLLoader is just the response from the server and not sending.

How to make a progress of "send"?

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
April 25, 2014

this is an excerpt from Flash Game Development: In a Social, Mobile and 3D World

do-loops, for-loops and while-loops

Loop types that execute from start to end before anything updates on stage include do-loops, for-loops and while loops. They cannot be used to animate objects because no matter what code you use to execute the loop and no matter what you do to (try and) slow it down, it will still execute from start to finish before anything changes on stage. They are appropriately used for rapid execution of code.

There is never a situation when you should intentionally slow these loops. However, there are situations when you might want to break these loops into more than one chunk so the stage can update between each chunk.

Chunks

For example, if you have a for-loop that takes 10 seconds to execute, your game will appear to freeze for 10 seconds after this loop starts. Nothing will update on stage and nothing will respond to user input. Either you should warn your user before starting that loop or you should break that loop into several smaller chunks that allow visual updates to the user so they do not think your game is broken.

Inspiring
April 26, 2014

What's this? Spam?

kglad
Community Expert
Community Expert
April 26, 2014

no, it's an explanation of how to display upload progress for a loop that cannot normally be interrupted.