Set limit on zoom variable

Whazzup;
Im stuck on this and need an “Action Script Hero”
to solve the prob…
Ive got this zoomable map working pretty well
but it keeps zooming out (ie. it dont stop!)
so I need to set a variable that limits the zooming out of
the map to a certain value like 200 and then pauses or
stops the movie clip.This would need to be set on
the rollover function see below.Does anybody know
a easy way of doing this!

on (rollOver) {
zoomMC.tzoomc=2;
}
on (rollOut, releaseOutside) {
zoomMC.tzoomc=0;
}

Im pulling my hair out ovr this!! Here is a link to the
fla file…

http://home.ripway.com/2004-3/80050/zoom_map.zip

Any help appreciated!!

Cheers loon!
I tried an if statement but it doesnt trigger the
else value if a user holds down the mouse,
I couldnt attach an onEvent either bcos
im using buttons…
So does any bright spark have a solution for this prob!!
see the fla below…

on(press) {
if (zoomMC.tzoom <= 140){
zoomMC.tzoomc=0;
}
else{
zoomMC.tzoomc=-2;
}

}

on (release, releaseOutside) {
_level0.host.zoomMC.tzoomc=0;
}

Well I’m not really sure if this is what you are going for but I changed your on enter frame to:


onClipEvent (enterFrame) {
	tzoom += tzoomc;
	_xscale = _yscale=_yscale+speed*(tzoom-_yscale);
	if (_xscale>400) {
		tzoomc = -2;
	} else if (_xscale<140) {
		tzoomc = 0;
	}
	trace(_xscale)
}

As you can see by the trace when the scale gets to be over 400 (and it will go over because of the easing) then it starts to zoom out automatically. You can’t put the code on the rollover because you have repeatedly roll on and off the button to get it to work, which I assume you don’t want.

Hope this helps! :hr:

edit You’ll have to play with the numbers to get it where you want it but you can hopefully get the idea of how it works.

@#&@!^$&^# Microsoft! I just wrote this whole long response and motherf**ing IE ate it! Argh! Wish we could use Mozilla at work :frowning:

I’ll try to rewrite in a minute when I’ve calmed down . . .

Ill wait ‘patiently’ lunatic!
tanx in advance for allyer time.
I tried puttin yer onClipEvent in my fla but dacontrol panel
wouldnt work then…
By the way this swf is being loaded into another swf
hence the level0.host. addressing…

Well, I messed with it for awhile and couldn’t make it stop. :frowning: I have to go to a meeting now but will try again when I get back. Seems like there should be a way to delete the on enter frame once the max or min scales have been reached but I think the on rollover function of the buttons is messing with that. I’ll try again later.