Skip to main content
New Participant
October 3, 2022
Question

Wait for all images load finished

  • October 3, 2022
  • 1 reply
  • 314 views

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

 
    This topic has been closed for replies.

    1 reply

    JoãoCésar17023019
    Community Expert
    October 3, 2022

    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.

    New Participant
    October 3, 2022

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

    JoãoCésar17023019
    Community Expert
    October 3, 2022

    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.

     

     

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