Skip to main content
Participant
Jul 8, 2023 7:33 PM UTC
Question

Adobe animate canvas code

How do i target a variable on frame 1(let score = 0) from buttons on other frames Thanks 

 

    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    kglad
    Community Expert
    Community Expert
    Jul 9, 2023 4:17 AM UTC

    reference the timeline.

     

    eg, to assign a variable:

     

    this.var1="hi";

     

    to retrieve that variable after it's been assigned:

     

    console.log(this.var1);  // if code on the same timeline

    Translate
    Community Expert
    Jul 9, 2023 1:16 AM UTC


    /* Code to get the frame number of the current frame
    */

    var frameNumber = this.currentFrame;

    Translate