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

Variables calling

Community Beginner ,
Apr 19, 2020 Apr 19, 2020

Copy link to clipboard

Copied

Hi all,

How to call a variable on the main stage from a code inside a movieclip and vice versa?

Thanks in advance..

Views

187

Translate

Translate

Report

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 ,
Apr 20, 2020 Apr 20, 2020

Copy link to clipboard

Copied

Hi.

 

HTML5 - Canvas - use the automatically generated global variable exportRoot.

Examples:

console.log(exportRoot);
console.log(exportRoot.yourProperty);
exportRoot.yourMethod();

 

AS3 - use the root property. But you have to cast it to MainTimeline or to MovieClip first.

Examples:

trace(MainTimeline(root));
trace(MainTimeline(root).yourProperty);
MainTimeline(root).yourMethod();

//OR
trace(MovieClip(root));
trace(MovieClip(root).yourProperty);
MovieClip(root).yourMethod();

 

I hope these help.

 

 

Regards,

JC

Votes

Translate

Translate

Report

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 Beginner ,
Apr 23, 2020 Apr 23, 2020

Copy link to clipboard

Copied

LATEST

Thanks I will try

Votes

Translate

Translate

Report

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