Skip to main content
Known Participant
November 14, 2018
Answered

I have two iframes with html generated with Animate cc. How can I make them communicate?

  • November 14, 2018
  • 2 replies
  • 1253 views

The problem is this. If you have a html genereted with Animate CC and that html is the source of an iframe in a container page and you want to communicate with that container page. Calling a function from the iframe to the container is not a problem. If you have a function called communication() you can easely adress it from the Animate CC generated file (I will call that ACCfile) with the statement: parent.communication() . But if I want it the other way around that's my problem.

I tried this. The id of the iframe is myFrame1, the function in the ACCflile, the scr of that iframe is listen(). So I have this:

document.getElementById('myFrame1').contentWindow.listen();

That does not work. I know why it doesn't work, becaus the function is in a sepparate jsfile. If I open the HTML of the ACCfile and write the function in that HTML file and save it, then that function is activated by the function call.

How can I acces that function whitch is in the external javascript generated with Animate CC?

This topic has been closed for replies.
Correct answer B i r n o u

It would be very nice if I can get the source files. I tried what you said, but probably I do something wrong.

No hurry. I'm busy doing something else.


yep here they are... http://www.birnou.net/koos/03-simple-com-double.zip

2 replies

B i r n o u
Legend
November 14, 2018

I'm sorry I have to go out of the office and will only come back late tonight (here in France, currently it's noon)... so before leaving... is that okay, do you need the source files?

idkoosAuthor
Known Participant
November 14, 2018

Ok, I'm at the office here and there is never a dull moment. That's why I don't always react as quickly as I want to. People come and go and there is allways something that has to be done that interupts me from what I was doeing. Just like this morning. Sorry!

idkoosAuthor
Known Participant
November 14, 2018

It would be very nice if I can get the source files. I tried what you said, but probably I do something wrong.

No hurry. I'm busy doing something else.

B i r n o u
Legend
November 14, 2018

try document.

getElementById('myFrame1').contentDocument.listen();

and be sure that this function in within flash is well set on the appropriate scope, so if the script is base on the root layer frame, declare the called function as

document.listen = function(){}

if that doesn't answer your question, please, use the sample on line Document sans nom  and let me know which animation must talk to who ?... one have Canvas 1, Canvas 2 and Host. That will help me to clarify...