Highlighted

Multiple HTML5 canvas on one page without Iframes

New Here ,
Feb 25, 2020

Copy link to clipboard

Copied

We have the need to have multiple canvases on one page, however the Animate HTML5/JS export always assumes there will always be only one canvas on the page ever.   I've read the previous solutions from years ago of using iframes, but that is just not an option for us.  

Seems like it would have be simple to include a namespace option for all the 'export-specific' js variables and functions in the Publish Settings, similar to custom namespaces for lib, createjs, and images.  Like instead of the main ID of 'canvas' could be 'canvasCustom1234' so there would be no conflicts.  Going through each exported html and renaming everything so they play nice with other exported code from Animate isn't a very good process - anyone find a way to get this to work without iframes?

Thanks

TOPICS
Code, Import and export, Publish package

Views

282

Likes

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

Multiple HTML5 canvas on one page without Iframes

New Here ,
Feb 25, 2020

Copy link to clipboard

Copied

We have the need to have multiple canvases on one page, however the Animate HTML5/JS export always assumes there will always be only one canvas on the page ever.   I've read the previous solutions from years ago of using iframes, but that is just not an option for us.  

Seems like it would have be simple to include a namespace option for all the 'export-specific' js variables and functions in the Publish Settings, similar to custom namespaces for lib, createjs, and images.  Like instead of the main ID of 'canvas' could be 'canvasCustom1234' so there would be no conflicts.  Going through each exported html and renaming everything so they play nice with other exported code from Animate isn't a very good process - anyone find a way to get this to work without iframes?

Thanks

TOPICS
Code, Import and export, Publish package

Views

283

Likes

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
Feb 25, 2020 0
Adobe Community Professional ,
Feb 25, 2020

Copy link to clipboard

Copied

Why are iframes not an option?

Likes

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
Reply
Loading...
Feb 25, 2020 0
New Here ,
Feb 28, 2020

Copy link to clipboard

Copied

Site policy.  Do you have any alternatives?

Likes

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
Reply
Loading...
Feb 28, 2020 0
Contributor ,
Feb 29, 2020

Copy link to clipboard

Copied

You could maybe use iframes with a data-uri as source filled with javascript?

Likes

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
Reply
Loading...
Feb 29, 2020 0
ClayUUID LATEST
Adobe Community Professional ,
Feb 29, 2020

Copy link to clipboard

Copied

Use iframes anyway. How will anyone know unless they go manually snooping through your source code?

Likes

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
Reply
Loading...
Feb 29, 2020 0