0

I have a really annoying intermittent issue when loading a series of assets using the Loader class in AIR 1.5.

I am creating four instances of a slideshow that I written, and 9/10 times it works but every now and then one or two of the slideshows fail and I found that it just stops loading images when that happens, maybe loads half of them, there are no runtime errors reported even though I use try and catch.

All the images are loaded sequentially but the slideshows are in parallel, I am thinking maybe this is the problem? Has anyone had issues with parallel loading? Should you always load sequentially even in AIR?

dain
  • 6,475
  • 1
  • 38
  • 47
Neil
  • 7,861
  • 4
  • 53
  • 74
  • "no runtime errors reported even though I use try and catch" - errors are reported through IOErrorEvent and SecurityErrorEvent, you can't catch error on asynchronous operation, it's out of your code. – alxx Mar 23 '11 at 12:28
  • @alxx, thanks i do have loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler); and that doesn't get invoked. I added the try catch to see if any other code was problematic, thx for comment. – Neil Mar 23 '11 at 15:48
  • It's looks like you have the same problem described here: http://stackoverflow.com/questions/5327422/flash-as3-is-there-a-limit-to-the-number-of-simultaneous-urlloader-load-reque/5328129 – divillysausages Mar 23 '11 at 12:14

1 Answers1

1

Yes, definitely try to avoid parallel loading, unless you have control over how many concurrent threads can run. So use a sequential load manager and maybe let it use multiple loading threads to work through the sequence, but not more than 2-3.

I think the reason why it's intermittent is because of speed variation, if it's fast enough you get everything loaded, but as soon as something is a bit slower you get failed loads.

dain
  • 6,475
  • 1
  • 38
  • 47
  • I am beginning to think that it is to do with the number of concurrent connections. I will see if I can get some dev time to change the to sequential and report back. Maybe there is a way I can force it to fail by getting the cpu to work on something at the same time. – Neil Mar 23 '11 at 15:56