this._lockroot = true;
//MAP SIZE
var xwidth:Number = 2860;
var yheight:Number = 1900;
//MAP COORDINATES
var longN:Number = 76.7; //Y1:0
var latW:Number = 74.0; //X1:0
var longS:Number = 40.3; //map helght Y2
var latE:Number = -44.6; //map width X2
//CONVERT MAP LONG, LAT TO X,Y COORDINATES
var x:Number;
var y:Number;
x = xwidth/(latE-latW);
y = yheight/(longN-longS);
trace("map x: " + x);
trace("map y: " + y);
function zoomClipToCoordinates(clip, top, left, bottom, right) {
var zoomWidth:Number = 670; //right minus left
var zoomHeight:Number = 488; //bottom - top;
var clipWidth = xwidth / (30/ 100);
var clipHeight = yheight / (30 /100);
if (zoomWidth <= 0 || zoomHeight <= 0) return false;
//Zoom to the correct portion of the clip
xwidth = Stage.width * (clipWidth / zoomWidth);
xheight = Stage.height * (clipHeight / zoomHeight);
//Position the clip to the top and left coordinates provided
clip._x = 0 - (left * (xwidth / clipWidth))
clip._y = 0 - (top * (yheight / clipHeight))
}
|