Movie Clips and Accessing the Main Timeline in HTML5 Canvas

Explorer ,
Sep 25, 2020 Sep 25, 2020

Copy link to clipboard

Copied

I have an Adobe Animate project that has a main timeline with movie clips every 5 frames. The movie clips have their own timelines with stories in them. This is an HTML5 project.

I set up a variable in Frame 1 of the main timeline _root = this to access the main timeline from within the movie clips. When I test the movie, I can navigate from the first movie clip to the second, but then I can't move from the second to the third. It also looks like the entire canvas is clickable after the first frame.

Should I not use movie clips and have everthing on the main timeline instead?

TOPICS
Code, Timeline

Views

258

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
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Sep 25, 2020 Sep 25, 2020
Animate automatically creates the global variable exportRoot that references the root timeline.

Likes

Translate

Translate
Adobe Community Professional ,
Sep 25, 2020 Sep 25, 2020

Copy link to clipboard

Copied

_root is defined only on the main timeline frame that contains that assignment.

 

this._root = this;

 

is defined on all main timeline frames (but i'm not sure that's any help to you).

 

just use "this" in your function bodies and make sure you use .bind(this) in your function definitions to maintain scope in your function bodies.

 

(or you could define _root=this on every frame where you want to use _root).

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
community guidelines
Explorer ,
Sep 25, 2020 Sep 25, 2020

Copy link to clipboard

Copied

kglad, thanks for that. Not sure if it's good practice to declare the same variable on every frame. I think I'm going to break out the movie clips' content onto the main timeline and go from there. Thanks.

 

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
community guidelines
Adobe Community Professional ,
Sep 25, 2020 Sep 25, 2020

Copy link to clipboard

Copied

that's generally not a good idea and i can't see how it helps, at all.

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
community guidelines
Explorer ,
Sep 25, 2020 Sep 25, 2020

Copy link to clipboard

Copied

Just to be clear, it's not a good idea to declare the variable on every keyframe? Moving all of the content onto the main timeline instead of clips should make the navigation easier, I think. 

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
community guidelines
Adobe Community Professional ,
Sep 25, 2020 Sep 25, 2020

Copy link to clipboard

Copied

Animate automatically creates the global variable exportRoot that references the root timeline.

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
community guidelines
Explorer ,
Sep 25, 2020 Sep 25, 2020

Copy link to clipboard

Copied

ClayUUID and how do you use that variable? exportRoot.gotoAndStop(20); ?

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
community guidelines
Adobe Community Professional ,
Sep 25, 2020 Sep 25, 2020

Copy link to clipboard

Copied

LATEST

yes, exportRoot.goto should work to direct the main timeline from any frame in any movieclip.

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
community guidelines