i've been stuck on this for quite a while, i'm working with a Main.as and LivrmScreen.as and basically LivrmScreen.as is a game screen with other movieclip actions going on... then i have a button on LivrmScreen that i wish to remove LivrmScreen itself and show homeScreen (all the homeScreen functions are in Main.as)
var homeScreen: HomeScreen;
public function LivrmScreen() {
backhomeBtn.addEventListener(MouseEvent.CLICK, onBackhomeBtnClicked);
}
function onBackhomeBtnClicked(evt:MouseEvent) {
homeScreen = new HomeScreen();
stage.addChild(homeScreen);
parent.removeChild(this);
}
this is what i have right now, i added parent.removeChild because it won't remove when it is just removeChild ... and because of that i added stage.addChild so that home screen will show up properly.
but then when homeScreen shows up the button's don't actually work ... so its just showing a dead movieclip. why is that???
i also tried to put the onBackhomeBtnClicked function in main.as thinking so that all the homeScreen functions are there and maybe the buttons will work... but in that case i cant even get the screens to remove and add properly