以下是我的代码,其中包含3次点击的页面,需要在用户向前移动第四个单击按钮之前将其记录为已选中。我知道这可能是一个粗略的快照/代码结构。
非常感谢任何建议。
我的代码:
var Checka:int = 0;
var Checkb:int = 0;
var Checkc:int = 0;
// Boxes to be clicked
MDI_07_btn.addEventListener(MouseEvent.CLICK, fl_ClickToShow_14a);
function fl_ClickToShow_14a(event:MouseEvent):void
{
MDI_07_box_mc.visible = true;
Checka = 1;
}
MDI_08_box_mc.addEventListener(MouseEvent.CLICK, fl_ClickToShow_14b);
function fl_ClickToShow_14b(event:MouseEvent):void
{
MDI_08_box_mc.visible = true;
Checkb = 1;
}
MDI_14_btn.addEventListener(MouseEvent.CLICK, fl_ClickToShow_14c);
function fl_ClickToShow_14c(event:MouseEvent):void
{
MDI_14_box_mc.visible = true;
Checkc = 1;
}
// Check for boxes correct and go to next frame
MDI_18_btn.addEventListener(MouseEvent.CLICK, fl_check36);
function fl_check36(event:MouseEvent):void
{
if (Checka == 1 && Checkb == 1 && Checkc == 1)
gotoAndStop(38);
else
Feedback_07_Wrong_mc.gotoAndPlay(2);
}