Sticky buttons problem

Hi,

Could you guys help me with this code:


MovieClip.prototype.sticky = function() {
    this.lockX = this._x; 
    this.lockY = this._y;
    this.spX = 0;
    this.spY = 0;
    this.onEnterFrame = function() {
        if (this.hitTest(_root._xmouse, _root._ymouse)) {
            this.newX = this.lockX + (_root._xmouse - this.lockX) * 0.65;
            this.newY = this.lockY + (_root._ymouse - this.lockY) * 0.65;
        } else {
            this.newX = this.lockX;
            this.newY = this.lockY;
        }
        this.spX += this.newX - this._x;
        this.spY += this.newY - this._y;
        this.spX *= 0.7;
        this.spY *= 0.7;
        this._x += this.spX;
        this._y += this.spY;
    };
};

menuholder.btn_booking.sticky();
menuholder.btn_galeria.sticky();
menuholder.btn_menu.sticky();
menuholder.btn_onas.sticky();
menuholder.btn_recenzje.sticky();

its protoype for sticky buttons, why it wont work for me ? when i rollower on my button it bounces like stupid, from one end of stage to another… is it becouse i have them in container ? (menuholder) ?

pls help :slight_smile: