I'm trying to recreate the code below in Construct 2. I think I have most of it correct, but the stop loop doesn't seem to work.
var array1 = new Array("a" , "g" , "e" , "j" , "a");
var array2 = new Array("b" , "a" , "c");
for each (var letter in array2) {
for (var i=0; i < array1.length ; i++) {
if (letter == array1(i)){
array1(i) = -1;
break;
}
}
trace(array1);
// OUTPUT: is -1,g,e,j,a
When the loop finds the first letter 'a' it changes it to '-1', but stops and doesn't change the last 'a'. In Construct the output is -1,g,e,j,-1. The only thing I can think of is that I'm not implementing the stop loop properly.
<img src="http://assets.universityalliance.com/construct/screenCap.jpg" border="0" />