changing levels

Hi all!
In my game for creating levels I'm trying to use frames. So in one new frame - one new level represented as physics world.
Game menu from which I can select level also represented as physics world with buttons - static shapes.
So the question : in what way i can choose next level/frame with my "button"? .Button has been included to world, so gotoAnd
Play methos works only with frames inside Menu world
Please help.
P.S: Sorry for my English 😳
The cheap and dirty way would be to call parent.gotoAndStop( levelNumber );

The more managed method would be to use a model/controller class that keeps the state of the current level index and interprets the key presses in the menu level and sends the game to frame A or frame B. When the menu level loads, the controller catches it and registers a listener to those key presses.

Is the menu level physics based? Does it need to be?

Good luck, 🙂
Yeah, thx a lot for advice!
I've tried to make some class for menu, so now level change works perfectly.
In each level's class and in menu class I got a pointer to main fla's class, so now I control levels from main game class. It works perfectly.
Thx again!

Original thread: https://box2d.org/forum/viewtopic.php?t=6778