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

Wait for all images load finished

New Here ,
Oct 03, 2022 Oct 03, 2022

Copy link to clipboard

Copied

Hi, I have a large GIF file(72MB) and I put this GIF into Adobe Animate, when publish and open the browser it may take a bit to display, I added a js file (\global script) that use exportRoot to control the GIF(goToAndPlay,...)  but I don't know when the GIF is load finished, is there any method like exportRoot.onFinish = function() {}  to trigger when the asset if load finished? Thanks

 

Views

192

Translate

Translate

Report

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
Community Expert ,
Oct 03, 2022 Oct 03, 2022

Copy link to clipboard

Copied

Hi.

 

Can you provide more details?

 

Because if you imported the GIF to the stage, then it's going to be a regular Movie Clip or Graphic symbol. And by default Animate only displays the main timeline when all assets are loaded.

Votes

Translate

Translate

Report

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
New Here ,
Oct 03, 2022 Oct 03, 2022

Copy link to clipboard

Copied

Hi, I want to know when all assets is loaded, do we have a callback function or event listener for that?

Votes

Translate

Translate

Report

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
Community Expert ,
Oct 03, 2022 Oct 03, 2022

Copy link to clipboard

Copied

You can simply run wherever code you need in the first frame of the main timeline. Code in the global script section runs before all assets are loaded.

 

But if you want to be more precise, you'll need to create a publish template and customize the code that Animate generates for the HTML.

 

image.png

 

Animate creates a LoadQueue and adds a complete listener to it. So you can customize the event handler (handleComplete).

Votes

Translate

Translate

Report

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
New Here ,
Oct 03, 2022 Oct 03, 2022

Copy link to clipboard

Copied

  1. Is there anyway for global script can know all asset is loaded instead update the code/modify template inside Adode Animate? Thanks

Votes

Translate

Translate

Report

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
Community Expert ,
Oct 03, 2022 Oct 03, 2022

Copy link to clipboard

Copied

Not that I can tell... At least not in hacky way.

 

It's because the queue is created inside of the init function so I'm not sure how you could access that.

Votes

Translate

Translate

Report

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
New Here ,
Oct 03, 2022 Oct 03, 2022

Copy link to clipboard

Copied

LATEST

I'm also aware this before posting, my solution is checking the canvas is filled or not in setInterval, not a good way but yeh 

Votes

Translate

Translate

Report

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