Hello,

I’ am getting crazy achieving some kind of zoom effect on my MC !!!
If you just create any MC on the stage like a rectangle 300*500 px and put
the code below in an empty frame, it will work…

But what i want to do is like setting new coordinates on the scaled MC so
that it takes the _xmouse/_ymouse click as the new center.
I mean : when the user clicks, it scales 150 percent but reposition it self
according to the mouse click as if it was the area zoomed into ;-)

Sorry, I hope I was understood !!!
Any kind ideas ?

Her’s my code :

mc.onMouseDown = function() {
        startX = this._x;
        startY = this._y;
        beginX = this._width;
        beginY = this._height;
        
        if (!this.scaled) {
                this.onEnterFrame = scaleIt(150);
                this.scaled = true;
        } else {
                this.onEnterFrame = scaleIt(100);
                this.scaled = false;
        }
};
function scaleIt(pScale) {
        return function () {
                this._xscale -= (this._xscale - pScale) * .1;
                this._yscale -= (this._yscale - pScale) * .1;
                this._x = ((beginX - this._width) / 2) + startX;
                this._y = ((beginY - this._height) / 2) + startY;
        };
}


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to