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
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.
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?
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.
Animate creates a LoadQueue and adds a complete listener to it. So you can customize the event handler (handleComplete).
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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