Move to a different frame within clip

1.19.4

So I’m trying to find a way where a button inside a clip can change the main frame to a different frame, It might be a bit confusing but this diagram maybe will help? untitled (13)

I have tried parent.gotoAndStop(x);, parent.parent.gotoAndStop(x);, and nothing else because beyond common programming language logic and the tools wick gives me, I don’t really know what to do.

Maybe this diagram is better
untitled (14) (1)
untitled (15)

use _root to access the main timeline.

_root.gotoAndPlay(numhere);

god im dumb, if it was in flash as its probably in wick js

Using this.parent should be able to take you back to the main timeline, but it’s a bit complicated because the parent of the clip is the frame it’s in, and the parent of that frame is the layer, and the parent of the layer is that clip’s timeline, and the parent of that is the object the timeline is in and — you get the point, you’d need to end up doing something like

this.parent.parent.parent.parent.parent.parent.parent.gotoAndStop(2);
// this > frame > layer > timeline > object > outside frame > layer > main timeline

just to switch to the second frame in the main timeline.

If you want to go to the main project and have it switch frames, you can also just use

project.gotoAndStop(2);
2 Likes

That’s a lot of parents.

2 Likes