Any help with the code below would be greatly appreciated! I’m really stuck.
The objective is when user clicks on any combination of 2 buttons you would then gotoAndPlay a new page based onthe** two specific buttons** you have selected? Ideally user would be able to intermix the button combinations.*
I’ve attached a simple diagram that visually explains objective of actionscript.*
Code below only works for two specific buttons, but doesn’t allow to intermix button clicks.
import flash.events.MouseEvent;
var blueClicked:Boolean = false;
var yellowClicked:Boolean = false;
var redClicked:Boolean = false;
var greenClicked:Boolean = false;
blue_btn.addEventListener(MouseEvent.CLICK, blue_onClick); yellow_btn.addEventListener(MouseEvent.CLICK, yellow_onClick); red_btn.addEventListener(MouseEvent.CLICK, red_onClick); green_btn.addEventListener(MouseEvent.CLICK, green_onClick);
function red_onClick(event:MouseEvent):void {
redClicked = true;
if(redClicked && greenClicked) {
proceedone(); }
}
function green_onClick(event:MouseEvent):void {
greenClicked = true;
if(redClicked && greenClicked) {
proceedone(); }
}
function proceedone():void {
trace(“both red and green buttons have been clicked”);
gotoAndStop (“about”);
}