Showing next set of thumb with fwd and prev button

Hi everyone,

I am going crazy with that thumbnail menu that i am currently working on…
I really dont get whats going on here in the code… It looks fine and even trace the values that i need but it just does not work.
In overall, i have an Empty MC which is populated with 8 thumb via a for loop each time i click the next button. When i press next it must go forward and show the next set of thumb of the xml file which have been loaded into a variable at very first.

The previous button works opnly when i am on the 2 nd set of thumbs but as soon as i am on the 3 or 4rth set then its a mess. the function does populate my array but does not show them… it says undefined