Detect previous child
I create 3 childs in my actionscripts. If I click "A", it will addChild "C", If I click "B", it will also addChild "C". A and B buttons are not in the same page. Now I want to go back to A and B after addChild C depends on previous child.
If I click A, then C, Back to A
If I click B, then C, Back to B
It is just similar to go back button. How can I do?
mainPage.btn1.addEventListener(MouseEvent.CLICK, onGoCon);
page1.btn2.addEventListener(MouseEvent.CLICK, onGoCon);
funtion onGoCon (evt:MouseEvent):void{
if (currentPage!=null){
removeChild(currentPage);}
addChild(C);
currentPage=C;
}
Now I want to go back. If I am from mainPage.Then go to mainPage. If I am from page1. then go to page1.
