Namespace issues when publishing HTML5 Canvas
Hi, I am developing an HTML/Canvas application with AnimateCC and JS libraries. We had the issue with one namespace value (i.e.: publish with Symbols as 'movie') for publishing in different .fla files. Probably it is what you mentioned on this thread.
The problem was 'movie' namespace is on global scope and it was overridden (or, concatenated) every time the browser finished loading a new 'movie' into memory, so it causes that the different methods are not being called to the corresponding reference in these sections. The solution is to reset the namespace 'movie' to null whenever you load in a new section.
For example:
queue.on('fileload', function(event) {
//Take a deep copy of movie and add it to content var
var content = $.extend(true, {}, movie);
// store exported 'movie/lib' namespaces in their section
_root.sections.namespace = content;
movie = null; // remove movie for next section
}
A note with recent update of Animate version 2017.5, Build 16.5.0.100, it seems to be a bug or an intention that the namespace was not exported at all. But you can get it from the global AdobeAn object.
var keys = Object.keys(AdobeAn.compositions);
var adobeCompositionId = keys[0];
var namespace = AdobeAn.compositions[adobeCompositionId].getLibrary();
console.log('AdobeAn namespace: ', namespace);
Hope it helps.
Cheers
