所以我终于让菜单工作了,但是当你回到菜单时我想删除当前的剪辑。我认为这会起作用,不幸的是它没有。有关如何使其工作的任何想法?我顺便使用OOP,这是我的课程之一。
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
public class MainClip extends MovieClip {
var currentClip:MovieClip;
public static const MY_FINISHED_MAINGAME_EVENT:String = "my_finished_mainGame_event"
//constructor code
public function MainClip() {
backToMenu.addEventListener(MouseEvent.CLICK, openMainMenu);
}
function removeCurrent () {
currentClip = new MainClip;
removeChild(currentClip);
}
//terug naar het Menu
public function openMainMenu (event:MouseEvent):void
{
dispatchEvent(new Event(MY_FINISHED_MAINGAME_EVENT));
currentClip = new IntroClip();
addChild(currentClip);
currentClip.x=200;
currentClip.y=200;
}
}