Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Adobe animate canvas code

New Here ,
Jul 08, 2023 Jul 08, 2023

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

 

145
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 08, 2023 Jul 08, 2023


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

var frameNumber = this.currentFrame;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 08, 2023 Jul 08, 2023
LATEST

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines