Openfl 4.8.1 : Preloader error load assets cause stopping loading at html5

I tried open my html5 games from online website and sometimes I got “Error load assets” (randomly can be sound, png, or fonts). That error cause my loading stopped and I must refresh it again to make loading working again.

Is it have connection with update lime 3.7.4, because change log : “Added verbose log messages during asset library preload”

This problems only occur at firefox pc browser.

For chrome pc browser never occur this problems.

I actually ran into the same problem with mobile Safari. It seems that some browsers place a hard limit on the amount of resources they will allow any single page to fetch from the internet. Other browsers have hard limits on how many concurrent connections they will allow for.

You’ll have to head over to the MDN and log a bug with their tracker if one doesn’t already exist.

Alternatively you could minimize your static asset pool and defer loading of - for instance, ‘Game Over’ screens until the game has started up.

This should reduce your initial resource pool and allow the preloader to complete. This is also, the solution we had to implement when building an HTML5 game.

In the short-term, you can set embed="false" on assets, and use Assets.load* instead of Assets.get* for loading.

Soon, I hope that a new release of Lime will come out with support for custom asset libraries, such as:

<assets path="level1" library="level1" />
<assets path="level2" library="level2" />
Assets.loadLibrary ("level1").onComplete (function (library) {
    var bitmapData = library.getBitmapData ("Image1.png");
    var bitmapData2 = Assets.getBitmapData ("level1:Image1.png");

It will allow bundling assets into distinct asset libraries, which can be loaded at once, with a single progress and complete. Then it is possible to access assets directly from the library, or using a prefix when calling the global Assets class

1 Like

But before using version 4.8.1 this problems never happen.

Last time I was using 4.4.1 version and still using NMEPreloader.

Is it have connection with the new preloader that extends Sprite instead of NMEPreloader?

If you have verbose asset loading, try using openfl test html5 -v, and it should show you which assets begin loading, which complete, and so if preloading hangs, we should be able to know which asset files it might have tripped up on

How to do “openfl test html5 -v” ? I’m using flash develop.

Open the Windows command-prompt, change to the directory of your project and run the command

I’ve had problems with cache in FlashDevelop on the HTML5 target, particularly.

It’s possible to also edit the target drop-down in FlashDevelop, so you can edit “html5” to “html5 -verbose”, but if the HTML5 project is not loading properly, I highly recommend trying the command prompt at least once to see if it works differently

I vote for something like this. If it will be released soon, I will be very happy… :slight_smile:

Sorry for long reply, I’ve test openfl test html5 -v and html5 -verbose and the different was there is a log message of assets like this [lime.utils.AssetLibrary] Loaded asset: images/UI/lose.png [598/651]

  1. IE : always stuck at preloader with random assets stuck. (random x/651)
  2. Firefox : sometime stuck sometime pass the preloader. Stuck issue was random assets too. (random x/651)
  3. Chrome : always pass the preloader.

The result was same like I mention it in the first post.

Wow, that’s a lot of assets. Well, by comparing the “Loaded” messages with the “Loading” messages, it should be possible to know what is not finished. I wonder if there’s a simpler way for us to figure that out. Perhaps its stuck on fonts?

Its stuck randomly, can be fonts, png, or sound. But before using the new preloader I’m never got this error.
Is there a way using old NMEPreloader on new version 4.8.1?

Was it the same assets before, same number of assets?

Do you think we have an incorrect calculation somewhere, or some other issue?

No, the assets always change example :

  1. stuck at 500/600 (images)
  2. stuck at 400/600 (sounds)
  3. etc.

Any news about this preloader issue at 4.8.1 version?

Maybe if we can choose to using NMEPreloader or the new preloader will be great.

I am seeing Preloader.hx:190: Error loading asset “sounds/achievement.ogg” but the file it there.

Could you please run openfl upgrade and see if the new release we made helps? Thanks :slight_smile:

1 Like

I’m working with Stein, he is trying that now :slight_smile:

I already tried the new version 4.9.0 but still got same error :frowning:

If you do a -verbose build, does it say what kind of asset it is loading your file as? Is it type TEXT, or BINARY, or something else?

…and the file definitely exists?

Did you say this is browser specific, or do all browsers fail to load this file?

Yes, the file definitely exists.

And here’s the test result online (I test it with window 7 64-Bit, 3 browser : IE, Firefox, and chrome):
1. IE - 5 times reload = 5x error type TEXT (.json) with different file

2 Firefox - 5 times reload = 1x error a lot of file type and 4x success

3 Chrome - 5 times reload = no error always success

But If I test it localhost, almost always successfull in 3 browser. Except IE and FF from 10 times try localhost maybe only 1x error.

I hope this information helpfull.