Variables calling

Community Beginner ,
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

141

Likes

Translate

Translate

Report

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

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
fminawi AUTHOR LATEST
Community Beginner ,
Apr 23, 2020

Copy link to clipboard

Copied

Thanks I will try

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more