Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Animate preloadJS "setMaxConnections" complications HTML/Javascript

Participant ,
Jan 11, 2018 Jan 11, 2018

Hi All,

I have added the following to the default exported content from animate in order to greatly speedup content pre-loading: PreloadJS API

loader.setMaxConnections(10);

loader.maintainScriptOrder = true;

The problem i have is that the "handleComplete" triggers before all the content has been downloaded. ( This problem gets worse when you emulate a slow network connection ) So the animate content starts even though its still downloading required images.

There are a few ways of doing this, but require overriding the way the default animate handleComplete ( see bellow ) works.

loader.addEventListener("complete", function(evt){handleComplete(evt,comp)});

As in adding array/loop that adds .complete / .onload to the images in the manifest and then overrides the complete function once they have all downloaded.

Edit: Possibly within animate:

this.stop on frame 1.....create another "EventListener", detect once all library/stage elements are loaded....this.play....

Thanks !!

591
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jan 12, 2018 Jan 12, 2018

I have used:

loader.setMaxConnections(6);

a lot, and not had loading problems. I haven't used loader.maintainScriptOrder = true; though, I wonder if that could be the problem?

BTW, I use (6) and not (10) because I tested all browsers, and many cases only went up to 6. The best case was Internet Explorer, it can do 11 at the same time, which, as you know, is one louder than 10.

Translate
LEGEND ,
Jan 12, 2018 Jan 12, 2018

I have used:

loader.setMaxConnections(6);

a lot, and not had loading problems. I haven't used loader.maintainScriptOrder = true; though, I wonder if that could be the problem?

BTW, I use (6) and not (10) because I tested all browsers, and many cases only went up to 6. The best case was Internet Explorer, it can do 11 at the same time, which, as you know, is one louder than 10.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 14, 2018 Jan 14, 2018

Ah, thanks for the input Colin, ill definitely reduce the amount for now.

I'm still doing some testing with regards to really slow/interrupted network connections, for a simple work-around, I'll maybe check network speeds and reduce the Max Connection amount....

Edit:

Looking at how animate sets everything up for load, it doesn't seem like maintainScriptOrder will actually do anything as the manifest file only loads images. ( Force adding JS files to the manifest didn't seem effect the load order either).

Thanks !

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 14, 2018 Jan 14, 2018
LATEST

I would just stick with 6. 6 at a time on a slower connection is still useful.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines