mardi 11 mai 2021

ActionScript 3 If Else for Button Click

I'm complete noob about this.

So, in a scene, there is an answer choice button A or B and a "next" button. In short, if we want to go to the next frame (click the "next" button), we have to click on one of the answer options first. However, I am confused about how to make the code. Can you guys help me? (sorry for my bad english)

errorframe5.visible = false;

var pressed = "yes";

nextbutton.addEventListener(MouseEvent.CLICK, nextframe6);
function nextframe6(event:MouseEvent):void
{
if(button_a == "no" && button_b == "no")
{
    errorframe5.visible = true;
}
else
{
    gotoAndStop(7, "Material");
}   
}       

Aucun commentaire:

Enregistrer un commentaire