Skip to main content
Participant
October 25, 2023
Question

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

  • October 25, 2023
  • 1 reply
  • 274 views

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.

 

    This topic has been closed for replies.

    1 reply

    JoãoCésar17023019
    Community Expert
    Community Expert
    October 25, 2023

    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_iframes

     

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

     

    Regards,

    JC

    Participant
    October 26, 2023

    Thanks  a lot JoãoCésar

    I will download this and check it this evening 🙂