if statement in a click event doesn't work, even when the condition is true
heres my code on frame 34
var q6music = true
var q6small = false
var q6gap = false
BigCollege.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_56);
function fl_ClickToGoToAndStopAtFrame_56(event:MouseEvent):void
{
gotoAndStop(42);
}
GapYear.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_57);
function fl_ClickToGoToAndStopAtFrame_57(event:MouseEvent):void
{
gotoAndStop(41);
var q6gap = true;
trace(q6gap);
}and on 41
trace(q6gap)
trace(q6music)
GoBack.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_58);
function fl_ClickToGoToAndStopAtFrame_58(event:MouseEvent):void
{
if (q6gap == true && q6music == true) {
trace("marked true");
gotoAndStop(44);
}
else {
gotoAndStop(34);
}
}when GapYear is clicked, q6gap is set to true and goes to frame 41. both q6gap and q6music trace as true at 41. however, the if statement doesn't run and it follows the else instead. there are no compiling errors and when I tried changing the else statement to else if (q6music == true) {trace("q6 music is true")} nothing ran when the button was clicked.
why won't the if statement run? maybe it can't access the variables?
