Problem with XML + Flash gallery with thumbs

I’ve discovered a problem when I began to change the design of gallery described here - http://www.kirupa.com/developer/mx2004/thumbnails.htm

First of all, when I moved the scroller with hit_left and hit_right movie clips to another place - the thumbs stoped showing on the page. And it’s not because of the mask layer. It’s because of the code problem.
When I’ve changed this code:

 
target_mc._x = hit_left._x+(target_mc._width+5)*k; 

to:

 
target_mc._x = 15 +(target_mc._width+5)*k; 

P.S. number 15 can be changed with onther one (0, 10, 20, 30) - it doesn’t make much difference - just offsets the scroller from 0 point.
It solved the problem, but then I’ve experienced another problem.
I’ve put this gallery in a Movie clip and then the scroller stopped scrolling at all.
The problem has to be somewhere here:


[COLOR=#006610]function [COLOR=#000050]thumbNailScroller[/COLOR][COLOR=#0000ff]()[/COLOR] [COLOR=#0000ff]{[/COLOR] [/COLOR]
[COLOR=#006610][COLOR=#cc00cc]// thumbnail code! [/COLOR]
[COLOR=#0000d0]this[/COLOR].[COLOR=#0000d0]createEmptyMovieClip[/COLOR][COLOR=#0000ff]([/COLOR][COLOR=#666666]"tscroller"[/COLOR], [COLOR=#991010]1000[/COLOR][COLOR=#0000ff])[/COLOR]; 
[COLOR=#000050]scroll_speed[/COLOR] [COLOR=#0000ff]=[/COLOR] [COLOR=#991010]10[/COLOR]; 
[COLOR=#000050]tscroller[/COLOR].[COLOR=#0000d0]onEnterFrame[/COLOR] [COLOR=#0000ff]=[/COLOR] function[COLOR=#0000ff]()[/COLOR] [COLOR=#0000ff]{[/COLOR] 
if [COLOR=#0000ff](([/COLOR][COLOR=#0000d0]_root[/COLOR].[COLOR=#0000d0]_ymouse[/COLOR][COLOR=#0000ff]>=[/COLOR][COLOR=#000050]thumbnail_mc[/COLOR].[COLOR=#0000d0]_y[/COLOR][COLOR=#0000ff])[/COLOR] [COLOR=#0000ff]&&[/COLOR] [COLOR=#0000ff]([/COLOR][COLOR=#0000d0]_root[/COLOR].[COLOR=#0000d0]_ymouse[/COLOR][COLOR=#0000ff]<=[/COLOR][COLOR=#000050]thumbnail_mc[/COLOR].[COLOR=#0000d0]_y[/COLOR][COLOR=#0000ff]+[/COLOR][COLOR=#000050]thumbnail_mc[/COLOR].[COLOR=#0000d0]_height[/COLOR][COLOR=#0000ff]))[/COLOR] [COLOR=#0000ff]{[/COLOR] 
if [COLOR=#0000ff](([/COLOR][COLOR=#0000d0]_root[/COLOR].[COLOR=#0000d0]_xmouse[/COLOR][COLOR=#0000ff]>=([/COLOR][COLOR=#000050]hit_right[/COLOR].[COLOR=#0000d0]_x[/COLOR][COLOR=#0000ff]-[/COLOR][COLOR=#991010]40[/COLOR][COLOR=#0000ff]))[/COLOR] [COLOR=#0000ff]&&[/COLOR] [COLOR=#0000ff]([/COLOR][COLOR=#000050]thumbnail_mc[/COLOR].[COLOR=#0000d0]hitTest[/COLOR][COLOR=#0000ff]([/COLOR][COLOR=#000050]hit_right[/COLOR][COLOR=#0000ff])))[/COLOR] [COLOR=#0000ff]{[/COLOR] 
[COLOR=#000050]thumbnail_mc[/COLOR].[COLOR=#0000d0]_x[/COLOR] [COLOR=#0000ff]-=[/COLOR] [COLOR=#000050]scroll_speed[/COLOR]; 
[COLOR=#0000ff]}[/COLOR] else if [COLOR=#0000ff](([/COLOR][COLOR=#0000d0]_root[/COLOR].[COLOR=#0000d0]_xmouse[/COLOR][COLOR=#0000ff]<=[/COLOR][COLOR=#991010]40[/COLOR][COLOR=#0000ff])[/COLOR] [COLOR=#0000ff]&&[/COLOR] [COLOR=#0000ff]([/COLOR][COLOR=#000050]thumbnail_mc[/COLOR].[COLOR=#0000d0]hitTest[/COLOR][COLOR=#0000ff]([/COLOR][COLOR=#000050]hit_left[/COLOR][COLOR=#0000ff])))[/COLOR] [COLOR=#0000ff]{[/COLOR] 
[COLOR=#000050]thumbnail_mc[/COLOR].[COLOR=#0000d0]_x[/COLOR] [COLOR=#0000ff]+=[/COLOR] [COLOR=#000050]scroll_speed[/COLOR]; 
[COLOR=#0000ff]}[/COLOR] 
[COLOR=#0000ff]}[/COLOR] else [COLOR=#0000ff]{[/COLOR] 
delete [COLOR=#000050]tscroller[/COLOR].[COLOR=#0000d0]onEnterFrame[/COLOR]; 
[COLOR=#0000ff]}[/COLOR] 
[COLOR=#0000ff]}[/COLOR]; 
[COLOR=#0000ff]}[/COLOR] 
[/COLOR]

But I don’t know exactly, where it can be.

I tried to change the _root._xmouse with a _root.gallery._xmouse and so on, but it didn’t help. The scroller began to scroll in one direction, and after he reached x=0, he tried to begin moving backwards, but after every small move - he moved towards zero point again.

Maybe someone could help me. I’m just tired of trying to understand, where can be a mistake.