Highlighted

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

132

Likes

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

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

133

Likes

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
Apr 19, 2020 0
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

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

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
Reply
Loading...
Apr 20, 2020 1
fminawi LATEST
Community Beginner ,
Apr 23, 2020

Copy link to clipboard

Copied

Thanks I will try

Likes

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
Reply
Loading...
Apr 23, 2020 0