Hello,
I have zoom code here
onClipEvent(load){
scrollMin = _root.range._x+_root.range._width // minimum _x value possiible for scrollbar
scrollMax = _root.range._x // maximum _x value possiible for scrollbar
lowestScale = 50 // lowest desired scale of map in %
highestScale = 200 // highest desired scale of map in %
_x = scrollMin + (scrollMax - scrollMin)/1.5 //starting point
scaleFactor = Math.pow(highestScale/lowestScale,1/(scrollMax-scrollMin)) // variable for SetScale
function SetScale(){
// calculates scale and sets it
_root.scale = _root.map_mc._xscale = _root.map_mc._yscale = lowestScale * Math.pow(scaleFactor,(scrollMax-_x))
}
SetScale()
}
onClipEvent(mouseMove){
if (dragging){
_x = Math.min(Math.max(_parent._xmouse,scrollMax),scrollMin)
SetScale()
updateAfterEvent();
}
}
When the file loads, zoom is at 75%. When the buttons in the code below are pressed I need the slider to move to 100%.
stopAllMCs = function(){
_root.map_mc.site39_mc.gotoAndStop(1);
_root.map_mc.site40_mc.gotoAndStop(1);
}
_root.srchMC.dataMC.site1_btn.onPress = function(){
stopAllMCs()
_root.map_mc.site39_mc.play();
_root.srchMC._visible=false;
}
_root.srchMC.dataMC.site2_btn.onPress = function(){
stopAllMCs();
_root.map_mc.site40_mc.play();
_root.srchMC._visible = false;
}
Looking at the code I thought maybe just attaching one line in the zoom code to each button in the frame…and change it…
_x = scrollMin + (scrollMax - scrollMin)/1.5 //starting point
to…
_x = scrollMin + (scrollMax - scrollMin)/2 //which is the point associated with 100%, but how would I assign this to the button?
Do I have to copy and paste all of the slider code into the frame where my btns are? _root.srchMC.dataMC.site1_btn.onPress…
Thanks.
To see this in action go to…
http://www.sergemedia.net/ds2/map/lakemap.html
Click on search button on stage. Click on first Homesite in list. It activates a blue polygon on map. I need slider on zoom to move to 100%.