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

How to insert an iFrame in Animate CC?

Community Beginner ,
May 08, 2019 May 08, 2019

Copy link to clipboard

Copied

I'm doing a walkthrough with animations, that I need to export in HTML 5, but also what I want to include is an iFrame to load a google map on it.

Is it possible to have a google map inside a canvas with Animate?

I would appreciate some help a ton!

Regards,

Hugo

Views

4.4K

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

Community Expert , May 08, 2019 May 08, 2019

If you use any of the HTML5 Canvas components, they get added to a DOM overlay layer which rests atop the actual canvas element. With that layer existing... you could use some JavaSCript target it and add child elements (such as an iframe).

You could also write your own component specifically for this task:

https://www.pluralsight.com/courses/animate-cc-building-custom-html5-components

Votes

Translate

Translate
LEGEND ,
May 08, 2019 May 08, 2019

Copy link to clipboard

Copied

The HTML5 canvas element is a 2-dimensional bitmap. You can put pixels in it. Nothing more, nothing less.

If you want to include any other native HTML elements "in" your canvas document, you have to fake it by floating them above the canvas element.

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
Community Beginner ,
May 08, 2019 May 08, 2019

Copy link to clipboard

Copied

I found an old tutorial in youtube, but it is for Adobe Edge.

Adding a Google Map - YouTube

Do you think this works for animate CC?

I have to clarify that I'm not a coder.

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
Community Expert ,
May 08, 2019 May 08, 2019

Copy link to clipboard

Copied

If you use any of the HTML5 Canvas components, they get added to a DOM overlay layer which rests atop the actual canvas element. With that layer existing... you could use some JavaSCript target it and add child elements (such as an iframe).

You could also write your own component specifically for this task:

https://www.pluralsight.com/courses/animate-cc-building-custom-html5-components

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
Community Beginner ,
May 09, 2019 May 09, 2019

Copy link to clipboard

Copied

Thank you so much JosephLabrecque​! I'll watch that training.

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 ,
May 09, 2019 May 09, 2019

Copy link to clipboard

Copied

You can add any js library to ANCC in global. I suppose it would work but I have not tried it.

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
Community Beginner ,
Mar 16, 2020 Mar 16, 2020

Copy link to clipboard

Copied

Did you manage to insert the iframe in Animate CC? I watched the video-example with Edge Animate but this doesn't work in ANCC ... Struggling with the same problem... 😞

 

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
Community Beginner ,
Nov 10, 2020 Nov 10, 2020

Copy link to clipboard

Copied

LATEST

Hi... if you want your map to be responsive to the canvas respectively animation container I recommend for example following method:

var newDiv = document.createElement("div"); 

/*determine by rule of three object related to camvas size:*/
newDiv.style.width = "...%";
newDiv.style.height = "...%";
newDiv.style.left = "...%";
newDiv.style.top = "...%";
newDiv.style.right = "...%";
newDiv.style.bottom = "...%";

newDiv.style.position = "relative";


newDiv.innerHTML = '<iframe name="NewIframe" scrolling="no" src="https://www.google.com/maps/..." marginwidth="0px" marginheight="0px" id="myFrame" allowfullscreen="" style="width: 100%; height: 100%; border:0px none #ffffff;  border: 0;"  frameborder="0"> </iframe>';

document.getElementById("animation_container").appendChild(newDiv);



var newDiv = document.createElement("div"); 

/*determine with rule of three based on original object's width and hight realted to canvas size:*/
newDiv.style.width = "39.05258%";
newDiv.style.height = "38.888888888%";
newDiv.style.left = "22.552083333333%";
newDiv.style.top = "38.611111111111%";
newDiv.style.right = "38.39533666667%";
newDiv.style.bottom = "22.5%";



newDiv.style.borderRadius = "10px";
newDiv.style.backgroundColor = "#ff0000";
newDiv.style.position = "relative";


newDiv.innerHTML = '<iframe scrolling="no" src="https://..." marginwidth="0px" marginheight="0px" id="myFrame" allowfullscreen="" style="width: 100%; height: 100%; border:0px none #ffffff;  border: 0;"  frameborder="0"> </iframe>';

document.getElementById("animation_container").appendChild(newDiv);

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