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?
_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).
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.
that's generally not a good idea and i can't see how it helps, at all.
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.
Copy link to clipboard
Animate automatically creates the global variable exportRoot that references the root timeline.
ClayUUID and how do you use that variable? exportRoot.gotoAndStop(20); ?
yes, exportRoot.goto should work to direct the main timeline from any frame in any movieclip.