beginbegin cannot be detected
I have issue with a value that should have just work, however, it seem to be a bug which I could not understand. Maybe you can find any bug?
Note: I have no issue with the "begin" and "end", just "beginbegin" and "endend" always return false.
My array values:
beginbegin,endend,-,-,-,begin,end,-,-,-,begin,end,-,-,-,-,begin,-,end
My code:
private var xm:int = 0;
private function createBeam():void {
for(var a:int=xm;a<naArray.length;a++) {
if(beamStatusArray[a]=="begin" || beamStatusArray[a]=="beginbegin") {
xm = a;
trace(beamStatusArray[a]=="beginbegin"); //always return false even there a "beginbegin" in the array
if(beamStatusArray[a]=="begin" || beamStatusArray[a]=="beginbegin") {
var getBeam:int = yArray[a]
for(var aa:int=a;aa<naArray.length;aa++) {
if(beamStatusArray[aa]=="end" || beamStatusArray[aa]=开发者_StackOverflow="endend") {
break;
}
}
}
}
}
The problem looks like it's with your loop code and not the string comparison. Why is the counter in the outer loop initialized to aa
instead of 0?
精彩评论