Hi - I’m trying to figure out a way to control the amount of zoom in this great effect. I’ve tried everything I can think of and so far, it just zooms tool close to my image. Any help is greatly appreciated!
Here’s the script:
onClipEvent (mouseDown) {
if (k>0) {
return;
}
zoom = true;
dir == 1 ? (dir=-1) : (dir=1);
if (dir == 1) {
pt = {x:_root._xmouse, y:_root._ymouse};
}
}
onClipEvent (enterFrame) {
if (!zoom) {
return;
}
_root._xscale += dirk50/8;
_root._yscale += dirk50/8;
var pt2 = {x:pt.x, y:pt.y};
_root.localToGlobal(pt2);
_root._x -= (pt2.x-pt.x);
_root._y -= (pt2.y-pt.y);
k++;
if (k == 8) {
zoom = false;
k = 0;
}
}
Thanks very much for your reply! Much appreciated!
I have tried to change the value of k and am still not able to stop the scaling effect where I’d like to. I just need it to zoom in a little and by changing the value of k to something like 2 or 3 (which is what I would have thought) I don’t get those results.
Even when I go about changing the value in this portion of the script:
No no no… maybe you missunderstood me.
K is the current zoom factor… and 8 is the maximum zoom factor.
So you try changing the 8 in that [color=blue]if(k==[color=red]8[/color])[/color]
or if you want it dinamically change that “IF” to something like
[color=blue]if (k == maxzoom) [/color]. That “IF statement” tells your function to stop zooming at a specified amount. You can previously define your maxzoom variable or put a simple number, like 8 for instance
Virusesco - I appreciate your patience. It’s not your explaination, but I’m afraid I’m not succeeding in getting it to zoom in <= where I’d like.
Again, forgive me, but where would you indicate the amount of the zoom? especially in the maxzoom option, where you mention you can previously define the max amount of zoom.
I understand that K is the current zoom factor… and 8 is the maximum zoom factor, but if the 8 in, if(k == 8) - can be changed to effect the zoom, why doesn’t it in my example?
Thanks again - and by the way, I also have a March 4th b-day!
Hey how would you go about adding buttons to this, ie: like that amplifiied.com example, like is it just purely with MCs ? Or is there AS button coding you can use with this ? Im trying to figure out how they did it, with those plus & minus btns, and how it zooms exactly onto their tiny text with great precision, or is more about adding proper zoom coding to the btn, in order to get precision, or maybe its with the AS ??.