Loading different assets for desktop and mobile

You could write a class that handles loading multiple files. Give it a list to load and then it would load them all individually and report when it’s all complete. You could even report progress based on files so if you’re currently loading file 3 of 6 then you’d show 50% loaded.

So the alternatives are:

  • 2 different applications compiled with conditional compiling in project.xml with if and unless
  • 1 application with non embedded assets to load manually

I have already tested the first option, I will test the second one too.

If you have more options, please report here

How do I know when loading is complete? And how do I enqueue more than one resource? What exactly useCache do? The documentation is a bit short in details.

I have done a local test with a single image, but I am just setting a delay before getting the loaded image, I’d like to know the exact moment the resource(s) is ready.

I am implementing a class to load images asynchronously, but it looks like HTML5 target have problems with the function to call when loading is complete: it is not called, as if COMPLETE event was not received:

Assets.loadBitmapData(bmdToDL, onComplete);

onComplete is never called

Flash target works correctly.

Are error handlers called instead?

No, you can see it with the project I sent you.