PDA

View Full Version : repositioning a map as it zooms


iaineach
05-06-2004, 12:26 PM
Can anyone help me with an actionscript query?

I've got a zoom function on a map which I need to reposition as it zooms in and out. I've got it working on the zoom in (kind of) but can't get it working on the zoom out.

I know I need to pass variables so that the map knows where it is at any time, and this is what I'm struggling with.

I've attached the files below (one containing the map, one containing the zoom function).


cheers,
iain

uten
05-07-2004, 01:39 AM
dude, i opened your fla. here's what you do. and i've done it successfully.

#1 - in your mksm_map3.fla, edit your "zoom_this" symbol. place your map right at the center of the symbol's registration point.

#2 - in your sliderbar.fla, remove this code below.

if (newsize < 100) {
newx = (getproperty("_level0/Map", _x)-"28.7");
newy = (getproperty("_level0/Map", _y)-"33.25");
setProperty("_level0/Map", _x, newx);
setProperty("_level0/Map", _y, newy);
}
else {
newx = (getproperty("_level0/Map", _x)+"28.7");
newy = (getproperty("_level0/Map", _y)+"33.25");
setProperty("_level0/Map", _x, newx);
setProperty("_level0/Map", _x, newy);
}


try it and let me know. :)

jon

iaineach
05-07-2004, 04:46 AM
Jon you're an absolute star!

That's it working as intended now, so thanks for getting back to me, it's much appreciated.

cheers,
iain