sorry for the OT response, but man this code makes me so glad I don't do AS2
anymore ;)
- e.

On Thu, Jun 12, 2008 at 12:48 PM, allandt bik-elliott <[EMAIL PROTECTED]>
wrote:

> hi guys - i queried this a few days ago when all the messages were
> disappearing into the hole - i've amended my code so it's pretty darn close
> to what i want but not quite
>
> basically, i'm writing an osx style dock and at the moment, the scaling is
> working perfectly but the positioning is a bit flaky - it looks like a
> string of beads on elastic that snap to the previous bead - i've posted an
> example here
> http://www.m2surveys.com/homeserve/dock/
>
> the code that governs the size and position is this method
>
>    private function addIconMouseListeners():Void
>    {
>        var ref:Object = this;
>
>        for (var i:Number = 0; i < aIconArray.length; i++)
>        {
>            mcScrollingIconContainer["clip"+i].sTitle    =
> aIconArray[i].sTitle;
>            mcScrollingIconContainer["clip"+i].sLink    =
> aIconArray[i].sLink;
>            mcScrollingIconContainer["clip"+i].nColour =
> aIconArray[i].nColour;
>            mcScrollingIconContainer["clip"+i].ID         = i;
>            mcScrollingIconContainer["clip"+i].thisX     =
> mcScrollingIconContainer["clip"+i]._x;
>            mcScrollingIconContainer["clip"+i].onMouseMove = function():Void
>            {
>                var thisXmouse = Math.round(this._xmouse);
>                var nIconSpan:Number = Math.round(ref.nIconWidth*5);
> //this governs the position and is the strange bit
>                var nXPercent:Number =
> Math.round(thisXmouse/nIconSpan*100)/1.8; // adjusting this by /1.8 has
> made
> the icons move along - otherwise they stay static, with only the moused
> over
> icon scaling and moving
>                nXPercent = (nXPercent > 45) ? 45 : (nXPercent < -45) ? -45
> : nXPercent;
>                this._x = this.thisX - nXPercent;
>
> // this governs the scale and works great
>                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;
>                    }
>                } else {
>                    this._yscale = this._xscale = 55;
>                }
>            };
>            mcScrollingIconContainer["clip"+i].onRollOver = function():Void
>            {
>                this.swapDepths(1000); // not needed after _x is figured out
>                ref.tfTradeTitle.text = this.sTitle;
>                ref.addGlow(this);
>
>            };
>            mcScrollingIconContainer["clip"+i].onRollOut = function():Void
>            {
>                ref.removeGlow(this);
>            }
>            mcScrollingIconContainer["clip"+i].onRelease = function():Void
>            {
>                getURL(this.sLink, "_self");
>                trace("getURL: "+this.sLink);
>            };
>
>        }
>    }
>
> could anyone make any suggestions as to how i can tighten it up, please? I
> could really use some help
>
> thanks a lot
> alz
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to