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

Call a function from a html-page which is inside an Animate animation

Community Beginner ,
Oct 25, 2023 Oct 25, 2023

Copy link to clipboard

Copied

Hi - i need some help.

I have a HTML-Page (a) with four buttons in it. By clicking one of this buttons a function "callNL(value)" will called which is within this page (a) - this works.

On the same HTML-Page (a) i have an iframe with the id "ifr_unten". In this iframe a HTML-Page (b) is running. This page (b) contains my Animate animation. In this animation there is a dynamic textfield, which should show some text if i click one of the buttons of page (a). To show the text there is a function "changeLanguage(value)" which i want to call via the function "callNL(value)" from page (a).

 

On page (a) i use

var iframe = document.getElementById("ifr_unten");

to get access to the page which is running in the iframe. The result is: [object HTMLiFrameElement]

To call the function within the animation i use then

var iframeDocument = iframe.contentDocument;
iframeDocument.defaultView.changeLanguage(indx);

But as result i get always NULL.

 

What to do? Can someone please help me.

 

Views

147

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 ,
Oct 25, 2023 Oct 25, 2023

Copy link to clipboard

Copied

Hi.

 

The link below is an example of how to handle communication between an iframe and a page.
https://github.com/joao-cesar/adobe/tree/master/animate%20cc/html5_canvas/communication_between_ifra...

 

Please let us know if this reference is helpful in your case.

 

Regards,

JC

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 ,
Oct 25, 2023 Oct 25, 2023

Copy link to clipboard

Copied

Thanks  a lot JoãoCésar

I will download this and check it this evening 🙂

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 ,
Oct 27, 2023 Oct 27, 2023

Copy link to clipboard

Copied

It helped! Thanks a lot!

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 ,
Oct 28, 2023 Oct 28, 2023

Copy link to clipboard

Copied

LATEST

You're welcome!

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