У меня есть ролик, который представляет собой прокрутку. Но есть проблема: В самый первый раз (единожды) при нажатии (уже при нажатии, т.е. еще даже не отпустил) мышкой на ползунок прокрутки - прокрутка смещается вверх примерно на 0,4-0,6. Происходит это только 1 раз (пырвый тык на ползунок) за компиляцию. Причем сместившись от первого тыка ползунок так и остается на том же месте (не на том, где должен). Подскажите где я ошибаюсь? Вот ссылка на *.fla и *.swf
http://***********/8071990
На всякий случай кидаю 2 скрипта:

Код:
stop();
var h = 0;
var sm = 1;
container.content._x = 0;
container.content._y = 0;
container.polosa._x = container.content._x+container.l._width;
container.polosa._y = container.content._height+h;
container.polosa._width = container.bound_box._width-container.l._width-container.r._width;
container.bound_box._x = container.content._x;
container.bound_box._y = container.content._y;
container.bound_box._height = container.content._height+container.polosa._height+h;
container.l._x = container.content._x;
container.l._y = container.polosa._y;
container.l._height = container.polosa._height;
container.r._x = container.bound_box._width-container.r._width-1;
container.r._y = container.polosa._y;
container.r._height = container.polosa._height;
container.scroller._x = container.content._x+container.scroller._width/2+container.l._width;
container.scroller._y = container.polosa._y+container.scroller._height/2;
container.mask._x = container.bound_box._x;
container.mask._y = container.bound_box._y;
container.mask._width = container.bound_box._width;
container.mask._height = container.content._height;
scroll_wheel_speed=5;
scrolling = true;
var mouseListener:Object = new Object();
mouseListener.onMouseWheel = function(delta) {
container.updateScrollbar ();
scr_width = container.scroller._width;
scr_diff = container.polosa._x - container.scroller._x +container.scroller._width/2;
scr_limit = container.mask._width-container.l._width-container.r._width+1;
if (delta>0) {
if ((1-scr_diff+scr_width)<scr_limit && (scr_limit-1+scr_diff-scr_width)>=scroll_wheel_speed){
container.scroller._x = container.scroller._x + scroll_wheel_speed;
scrolling = true;
}
else {
container.scroller._x = container.scroller._x + scr_limit-1+scr_diff-scr_width;
scrolling = true;
}
}
else {
if (scr_diff<0 && (container.scroller._x -container.polosa._x - container.scroller._width/2)>=scroll_wheel_speed){
container.scroller._x = container.scroller._x - scroll_wheel_speed;
scrolling = true;
}
else {
container.scroller._x = container.scroller._x - (container.scroller._x -container.polosa._x - container.scroller._width/2);
scrolling = true;
}
}
container.updateScrollbar ();
}
Mouse.addListener(mouseListener);
И второй

Код:
onClipEvent (load) {
diff_x = polosa._width-scroller._width;
bounds = polosa.getBounds(this);
left = bounds.xMin+(scroller._width/2);
right = bounds.xMax-(scroller._width/2);
function updateScrollbar () {
if (scroller._x < left) {
scroller._x = left;
}
if (scroller._x > right) {
scroller._x = right-0.4;
}
content._x = -(((scroller._x-left)/diff_x)*(content._width-bound_box._width));
}
friction = 0.90;
}
onClipEvent (mouseDown) {
if (scroller.hitTest(_root._xmouse, _root._ymouse)) {
//scroller._y +=0.6;
//trace(scroller._y);
startDrag ("scroller", false, left, scroller._y, right, scroller._y );
scrolling = true;
}
}
onClipEvent (mouseUp) {
stopDrag ();
scrolling = false;
}
onClipEvent (enterFrame) {
if (scrolling) {
updateScrollbar();
newx = scroller._x;
xspeed = (newx-oldx)*0.50;
oldx = newx;
done = false;
} else if (!done) {
oldxpos = scroller._x;
newxpos = oldxpos+xspeed;
if (xspeed<-0.2 || xspeed>0.2) {
xspeed *= friction;
} else {
xspeed = 0;
done = true;
}
if (newxpos<left) {
xspeed = -1*xspeed*friction;
newxpos = left;
}
if (newxpos>right) {
xspeed = -1*xspeed*friction;
newxpos = right;
}
scroller._x = newxpos;
updateScrollbar();
}
}