[RESOLVED] Code causes mysterious lock-up
I've got a button, based on how many times you've pressed it it displays a message. This is the code:
Actionscript Code:
stop();
cexitbt.addEventListener(MouseEvent.MOUSE_DOWN,gotoCMainframe);
var ClickCounter:Number;
var errortext:MovieClip;
this.ClickCounter =0;
//return;
this.brainbt.addEventListener(MouseEvent.MOUSE_DOWN,interfaceMe);
function interfaceMe(event:MouseEvent):void
{
this.ClickCounter +1;
if(this.ClickCounter >= 9)
{
this.errortext.gotoAndStop(10);
}
else
{
this.errortext.gotoAndStop(this.ClickCounter);
return;
}
}
qlbt.addEventListener(MouseEvent.MOUSE_DOWN,qualityLow);
function qualityLow(event:MouseEvent):void
{
stage.quality = "low";
}
qmbt.addEventListener(MouseEvent.MOUSE_DOWN,qualityMed);
function qualityMed(event:MouseEvent):void
{
stage.quality = "medium";
}
qhbt.addEventListener(MouseEvent.MOUSE_DOWN,qualityHi);
function qualityHi(event:MouseEvent):void
{
stage.quality = "high";
}
qbbt.addEventListener(MouseEvent.MOUSE_DOWN,qualityBest);
function qualityBest(event:MouseEvent):void
{
stage.quality = "best";
}
This obviously doesn't work because the return is commented out. But if I un-comment it, ALL the buttons on the frame stop working! I have no idea what's going on and its starting to aggravate me. Any ideas?
EDIT: Okay, nevermind... turns out making it add and assign one (this.ClickCounter +=1) fixed the counter and putting all the listeners before the return fixed that issue.