Compare 2 arrays Actionscript 3

Following is a usfull function to compare 2 arrays this is not my code i found it in an anther blog. i thought it's useful so i'm posting it here


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;
}
}
return array3;
}

0 comments:


PHP developer Cochin |PHP developer Kerala | PHP developer India | Flash developer/programmer Cochin | Flash developer/programmer Kerala | Flash developer/programmer India | web programmer kerala |web programmer Cochin |web programmer India |web developer kerala |Web developer Cochin | Kerala PHP | PHP freelancer| flash actionscript freelancer