Skip to main content
Participant
July 8, 2023
Question

Adobe animate canvas code

  • July 8, 2023
  • 2 replies
  • 134 views

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

 

    This topic has been closed for replies.

    2 replies

    kglad
    Community Expert
    Community Expert
    July 9, 2023

    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

    Community Expert
    July 9, 2023


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

    var frameNumber = this.currentFrame;