Copy link to clipboard
Copied
Hi,
I update the program yesterday to 2017.5 Release, build 16.5.1.104, and since then everything I publish displays a blank page, but the files I made before the update still working fine. I try to duplicate the old file and publish again with the new update, now it shows blank.
Is there any error with the new version of the program? I'm so confused, everything was working fine until this new update. When I inspected the html file in the browser it shows this error
abc.html:700 Uncaught ReferenceError: lib is not defined
at dfpImages (abc.html:700)
at onload (abc.html:717)
Does anyone know how to fix it?
1 Correct answer
There has obviously been a change to the way "lib" is declared and scoped in the html5 output. I have been using my own javascript files added to the html page to add, control and remove instances from the library at runtime. After updating Animate CC to 2017.5 build 16.5.1.104, I was getting the same error of lib not defined. After clearing, my cache, republishing a new html5 page and generally pulling my hair out - as my code has been working just fine before the update, I started to look at w
...Copy link to clipboard
Copied
Clear your browser's cache.
Copy link to clipboard
Copied
The HTML most likely has changed in the later version. If you have used custom HTML you would need to go into the templates are recreate whatever was custom. If you didn't do anything to the HTML template, then go into publish settings, advance tab, check the box to overwrite the HTML, and click the Use Default button if it's enabled.
Copy link to clipboard
Copied
There has obviously been a change to the way "lib" is declared and scoped in the html5 output. I have been using my own javascript files added to the html page to add, control and remove instances from the library at runtime. After updating Animate CC to 2017.5 build 16.5.1.104, I was getting the same error of lib not defined. After clearing, my cache, republishing a new html5 page and generally pulling my hair out - as my code has been working just fine before the update, I started to look at where 'lib' was declared in the published html5 page.
While I'm not sure where it was declared previously (I couldn't find that right off in my old files), I found it is now declared several times and no longer available at the root level of the DOM, but is scoped to the composition. In the HTML page, it is only declared locally to functions init() and handleComplete().
However, if you are using frame scripts within Animate to instance a library object by its class name, it all works fine - as it's in the composition scope. So, 'lib' must be scoped to the composition somewhere. It just appears as it's not longer available to the html page itself.
To get it to work with my external scripts, I changed 'lib' to be scoped to the page level (added it to the var list above the init function) and ensured it was only assigned once in the init() function. This might not be the best way, but all seems to be working fine for me now.
Copy link to clipboard
Copied
'lib' is no longer directly accessible globally.
You can something like below in frame scripts, to make it available for external access.
document.lib = lib;
Now you can access the lib via document.lib in external scripts.

