Highlighted

Parent Variable Undefined with Camera Layer

Community Beginner ,
Apr 12, 2020

Copy link to clipboard

Copied

Hi,

the problem I encountered exceeds my understanding of Animate CC and its framework and for this reason I would like to reach out to the community's knowledge base.

 

I have a variable called '_this.inloop' in the mainframe which is set to 1 and controls a loop there. It is defined right at the beginning. A symbol reads thise value and changes it to 0 as soon as its timeline reaches a certain point releasing the loop in the mainframe. This is done by the command:

_this.parent.inloop = 0;

Everthing works like a charm! But as soon as I want to use the camera creating a camera layer, the symbol cannot read the variable in the mainframe anymore telling that it is 'undefined'.

 

As I do not understand what the problem is that the camera creates, I have no idea how to fix this. Has anyone encoutered this problem, maybe even found a solution? I would be grateful for any clue.

Thanks!

Community Beginner
Correct answer by dcpust | Community Beginner

Okay, the solution was rather simple. After taking a closer look at the whole thing and looking for the variable 'inloop', I could finally find it in the parent-node of the parent-node, for whatever reason. With this information, it was possible to call the variable in the mainframe with the command:

_this.parent.parent.inloop = 0;
TOPICS
Code, Error, Timeline

Views

353

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

Parent Variable Undefined with Camera Layer

Community Beginner ,
Apr 12, 2020

Copy link to clipboard

Copied

Hi,

the problem I encountered exceeds my understanding of Animate CC and its framework and for this reason I would like to reach out to the community's knowledge base.

 

I have a variable called '_this.inloop' in the mainframe which is set to 1 and controls a loop there. It is defined right at the beginning. A symbol reads thise value and changes it to 0 as soon as its timeline reaches a certain point releasing the loop in the mainframe. This is done by the command:

_this.parent.inloop = 0;

Everthing works like a charm! But as soon as I want to use the camera creating a camera layer, the symbol cannot read the variable in the mainframe anymore telling that it is 'undefined'.

 

As I do not understand what the problem is that the camera creates, I have no idea how to fix this. Has anyone encoutered this problem, maybe even found a solution? I would be grateful for any clue.

Thanks!

Community Beginner
Correct answer by dcpust | Community Beginner

Okay, the solution was rather simple. After taking a closer look at the whole thing and looking for the variable 'inloop', I could finally find it in the parent-node of the parent-node, for whatever reason. With this information, it was possible to call the variable in the mainframe with the command:

_this.parent.parent.inloop = 0;
TOPICS
Code, Error, Timeline

Views

354

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 12, 2020 0
Guide ,
Apr 13, 2020

Copy link to clipboard

Copied

Hi mate,

 

See if the info here is somehow relevant:  https://helpx.adobe.com/animate/using/timeline-layers.html?mv=product&mv2=an#advanced-layers

 

- Nick: Character designer and animator, Flash user since 1998
Member of Flanimate Power Tools team - extensions for character animation

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 13, 2020 0
Community Beginner ,
Apr 17, 2020

Copy link to clipboard

Copied

Thanks for your help!

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 17, 2020 0
Community Beginner ,
Apr 17, 2020

Copy link to clipboard

Copied

Okay, the solution was rather simple. After taking a closer look at the whole thing and looking for the variable 'inloop', I could finally find it in the parent-node of the parent-node, for whatever reason. With this information, it was possible to call the variable in the mainframe with the command:

_this.parent.parent.inloop = 0;

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 17, 2020 0
Adobe Community Professional ,
Apr 17, 2020

Copy link to clipboard

Copied

Hi.

 

Glad to hear that you found out the solution!

 

Just wanna to add that whenever you need to access the main timeline, just use the automatically created global variable exportRoot.

 

So no matter how deep you are in the display list you can access the main timeline by writing something like:

exportRoot.gotoAndPlay(2);

 

 

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 17, 2020 0