Button 菜单按钮不工作

Button 菜单按钮不工作,button,user-interface,actionscript,menu,actionscript-2,Button,User Interface,Actionscript,Menu,Actionscript 2,我试图制作一个菜单屏幕,允许用户按下包含以下实例的按钮。我知道我差不多有了它,但我不知道它出了什么问题 stop(); home_btn.onRelease { gotoAndStop(1); } graphics_btn.onRelease { gotoAndStop(3); } animation_btn.onRelease { gotoAndStop(2); } 您可以使用mx.utils.Delegate类: 导入mx.utils.Delegate home_

我试图制作一个菜单屏幕,允许用户按下包含以下实例的按钮。我知道我差不多有了它,但我不知道它出了什么问题

stop();

home_btn.onRelease {
    gotoAndStop(1);
}
graphics_btn.onRelease {
    gotoAndStop(3);
}
animation_btn.onRelease {
    gotoAndStop(2);
}

您可以使用mx.utils.Delegate类:

导入mx.utils.Delegate

home_btn.onRelease = Delegate.create(this, function() {
    gotoAndStop(1);
})

添加
=function()

在代码中尝试过“\u parent.gotoAnd…”吗?
stop();

home_btn.onRelease = function() {
    gotoAndStop(1);
}
graphics_btn.onRelease = function() {
    gotoAndStop(3);
}
animation_btn.onRelease = function() {
    gotoAndStop(2);
}