Answer the question
In order to leave comments, you need to log in
How to close current scene and display another one in AS3?
In general, I wrote the code for the mini-game.
I need to make it so that after the game ends, the scene with the game closes and the scene with the main menu opens.
This is the part of the code where the game ends, in class N
var GoMenu:Main = new Main();
addChild(GoMenu); //Добавляю сцену с меню
GoMenu.closePlay(); //Вызываю функцию с закрытием сцены игры из Main класса
public function closePlay():void
{
GoPlay2 = new SceneGame();
removeChild(GoPlay2); //Пытаюсь закрыть сцену с игрой
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question