Problems recognizing the 'end' of an array

Hi guys, you have all been very helpful in the past, so im hoping you can help me with this one bit of refinement. here is the code…

SetNextProject = function () {
	i++;
	ProjectPreloadB(currentArray*);
	if (i>=currentArray.length) {
		_root.mc_projects.mc_projectsLoadedB.mc_arrowF._visible=false;
	} 
	else (_root.mc_projects.mc_projectsLoadedB.mc_arrowF._visible=true)
};

The point of this code is to make button mc_arrowF go away when the end of the array is reached. Its BASICALLY working, however when i load, say currentArray[18], the end of the array, the button doesn’t disappear until i press it again. Basically, the button doesnt disappear until currentArray[19]… even though currentArray.length=18. A

How can i fix this? any help would be appreciated!