arrays

/Tag:arrays

Compare 2 arrays with AS 3

The following function compares the values ​​of two arrays and returns another array with different values​​. private function checkArrays(array1:Array,array2:Array):Array { var array3:Array=new Array(); var length1:int=array1.length; var none:Boolean=false; for(var i:int=0;i < length1;i++) { var length2:int=array2.length; for(var j:int=0;j < length2;j++) { if(String(array1[i])==String(array2[j])) { none=false; break; } else { none=true; } } if(none) { array3.push(array1[i]) none=false; } [...]

By | 2013-01-21T07:27:31+00:00 January 21st, 2013|Actionscript 3.0, Blog|0 Comments