• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Displaying the same canvas at multiple locations

Explorer ,
Dec 26, 2016 Dec 26, 2016

Copy link to clipboard

Copied

If I try to display a single canvas in multiple locations, for example in the header of all the pages on a site, I run into problems, because the js file created by Animate looks for the image files in a location relative to the page itself, resulting in 404 not found errors for all imported images.

Everything works fine except that any imported images are missing.

This must be a common problem, I'm hoping there is an easy answer, maybe an edit to the js generated by Animate, or a setting somewhere in Animate, to make it possible for the links to images in the library to be absolute rather than relative?

I have looked at the generated js, but I can't see what I need to do. I am a front-end designer rather than a developer or js expert. I have got round this in the past by putting the canvas in an iframe, but surely there is a better way?

Views

317

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
community guidelines

correct answers 1 Correct answer

Enthusiast , Dec 26, 2016 Dec 26, 2016

Just open generated js and type in the find text box .jpg or .png or library properties and change path (src) of images.

lib.properties = {

  manifest: [

  {src:"image1.jpg", id:"image1"},

  {src:"image2.jpg", id:"image2"},

  {src:"image3.jpg", id:"image3"},

  {src:"image4.jpg", id:"image4"},

  {src:"image5.jpg", id:"image5"}

  ],

};

Votes

Translate

Translate
Enthusiast ,
Dec 26, 2016 Dec 26, 2016

Copy link to clipboard

Copied

Just open generated js and type in the find text box .jpg or .png or library properties and change path (src) of images.

lib.properties = {

  manifest: [

  {src:"image1.jpg", id:"image1"},

  {src:"image2.jpg", id:"image2"},

  {src:"image3.jpg", id:"image3"},

  {src:"image4.jpg", id:"image4"},

  {src:"image5.jpg", id:"image5"}

  ],

};

Votes

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
community guidelines
Explorer ,
Dec 28, 2016 Dec 28, 2016

Copy link to clipboard

Copied

LATEST

Yes, that seems to work fine. Thanks.

Votes

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
community guidelines
LEGEND ,
Dec 26, 2016 Dec 26, 2016

Copy link to clipboard

Copied

Comus Sola wrote:

I have got round this in the past by putting the canvas in an iframe, but surely there is a better way?

What do you believe is wrong with using iframes?

Votes

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
community guidelines
Explorer ,
Dec 26, 2016 Dec 26, 2016

Copy link to clipboard

Copied

Not sure, I just feel like using an iframe is kind of a quick fix, and while it would probably be fine in most cases there might be some situations where it would be better to know how to add canvas directly to the page. It seems like I would be adding an extra layer of complexity simply because I didn't have a good enough understanding of the Animate generated code.

Votes

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
community guidelines