Going mad on osx style dock positioning - please help

[FONT=Courier New][SIZE=2]please help - i’m going mad on this

I’ve gotten my dock to scale exactly as i want it to - going from 55% of it’s size up to 100% and then back down to 55% but i just can’t get the positioning right no matter what i do

here is my onMouseMove code that does the scaling - i’ve commented out my aborted attempts to do the positioning

i really need help - it’s 11.15 and i’m at a loss


mcScrollingIconContainer["clip"+i].onMouseMove = function():Void
{
    var thisXmouse = Math.round(this._xmouse);
    var nIconSpan:Number = Math.round(ref.nIconWidth*5);
    var nXPercent:Number = Math.round((thisXmouse/nIconSpan) *100);
    
    if (thisXmouse < nIconSpan && -1*thisXmouse < nIconSpan)
    {
        var nWidth:Number = ref.nIconWidth + ref.nIconSpacing;
        var nPercent:Number = Math.round((thisXmouse < 0) ? (thisXmouse/nIconSpan) *-100 : (thisXmouse/nIconSpan) *100);
        nPercent = 100 - nPercent;
        
        if (nPercent > 55)
        {
            this._yscale = this._xscale = nPercent;
            
        } else {
            this._yscale = this._xscale = 55;
        }
        
        //if (nXPercent > -45 && nXPercent < 45)
        //{
            //var nMoveToX:Number = this.thisX*((nXPercent/100)+1);
            //trace(this.thisX + " :: " + nMoveToX);
            //
            //this._x = nMoveToX;
        //} else if (nXPercent > 45) {
            //this._x = this.thisX * nXPercent;
        //}
    } else {
        this._yscale = this._xscale = 55;
        //this._x = this.thisX;
    }
};


thankyou
alz[/SIZE][/FONT]