AS2: Array Slice and Pop

Hello,

I am using the following code to make an array of 3 values and each time a button is clicked it adds a number to a certain location in the array - so the value one goes into slot 0 and so on…


_global.slotArray = Array("", "", "");

add_mc.onRelease = function(){
	_global.slotArray.splice(0,0,"1");
	_global.slotArray.pop();
	trace(_global.slotArray);
}

add2_mc.onRelease = function(){
	_global.slotArray.splice(1,0,"2");
	_global.slotArray.pop();
	trace(_global.slotArray);
}

add3_mc.onRelease = function(){
	_global.slotArray.splice(2,0,"3");
	_global.slotArray.pop();
	trace(_global.slotArray);
}

If I click the buttons in order of add, add2 and add3 then the array looks fine like so: 1,2,3 however if I click them out of order it produces the following result: 1,2 and 3 goes missing - it seems to be popping out values.

Anyone know why this is?

Any help would be great thanks