Skip to main content
October 31, 2007
Answered

problems with an if statement

  • October 31, 2007
  • 1 reply
  • 175 views
alright here it is guys:function popLoop ( popArray, tracerArray ) {
for( n = 0 ; n < popArray.length ; n++){
trace(popArray.length);
trace(n);
if (n = popArray.length){
trace("sure");
}
}
}

popArray.length = 3 FYI

so whats happening is i want the for statement to run through "popArray.length" [3] times.
the for loop contains commands to duplicate movies but the thing is it stops after the ending if statement...

does anyone know why the if statement stops the for loop???
This topic has been closed for replies.
Correct answer kglad
use double equal (==) to test for equality.

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
October 31, 2007
use double equal (==) to test for equality.