Hi there- I having some problems with a really simple loop that i cant quite figure out whats wrong. I want to scroll through an array of elements (strings such as as, al, sa, etc), and remove a certain element from the array when it gets to it. here i have used “sa”… below is my code
//loads shared object
this.mySO = SharedObject.getLocal(“test”, “/”);
mySO.data.theArray2 = new Array();
alength = mySO.data.theArray.length;
for (i = 0; i < alength; i ++ )
{
if (mySO.data.theArray* = “sa”)
{
mySO.data.theArray2 = mySO.data.theArray.slice(i);
}
}
trace (mySO.data.theArray);
trace (mySO.data.theArray2);
here i have tried to create a new array by slicing off the part that i dont want. i think this method wiull shuffle all the other elements down to create a new array 1 space shorter and with no null elements.
at the moment it seems to be changing ALL elements to sa. Im scratching my head but nothing
any help would be greatly appreciated!!
chimpo