Skip to main content
Participant
March 12, 2022
Question

interaction between several canvas

  • March 12, 2022
  • 1 reply
  • 176 views

Hello, I am looking for how to make two canvas placed on the same page communicate. On each canvas there is a button (movieclip) to turn on or off a light (movieclip). I'm trying to turn on or off the LED from each button of the two canvas but I don't know how to do it. Thank you for your help.

    This topic has been closed for replies.

    1 reply

    JoãoCésar17023019
    Community Expert
    Community Expert
    March 12, 2022

    Hi.

     

    This sample may help you:

    https://github.com/joao-cesar/adobe/tree/master/animate%20cc/html5_canvas/communication_between_iframes

     

    Please let us know.

     

    Regards,

    JC

    papayou75Author
    Participant
    March 17, 2022

    Hello,
    Thanks for your help, exportRoot was needed.

    Now I can change frame (gotoAndStop) or change variable value of another canvas :

    exporRoot_scriptA.MC_B.gotoAndStop(1);

    exporRoot_scriptB.var_A=true;

    However, I can't launch a Canvas B function from the Canvas A script. For example: exporRoot_scriptA.function_scriptB(); does not work.

    In the console I have the following response: is not a function when calling the command exporRoot_scriptA.function_scriptB();
    Thank you in advance for your help.