//import fl.controls.Slider;
//import fl.events.SliderEvent;
//import flash.events.MouseEvent;
//import flash.printing.PrintJob;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
var legendVis:Boolean = new Boolean;
legendVis = false;
winFindMaps.visible = false;
remote.addEventListener(MouseEvent.MOUSE_DOWN, rDrag);
remote.addEventListener(MouseEvent.MOUSE_UP, rDragStop);
function rDrag(e:MouseEvent):void {
remote.startDrag();
}
function rDragStop(e:MouseEvent):void {
remote.stopDrag();
}
remote.btnMapBox.addEventListener(MouseEvent.CLICK, launchMapBox);
function launchMapBox(e:MouseEvent):void {
winFindMaps.visible = true;
}
winFindMaps.btnWinFindMapsClose.addEventListener(MouseEvent.CLICK, closeMapBox);
function closeMapBox(e:MouseEvent):void {
winFindMaps.visible = false;
} //Remote Functionality
legend.bntLegend.addEventListener(MouseEvent.CLICK, legendMover);
function legendMover(e:MouseEvent):void {
if( legendVis == false) {
var myTween:Tween = new Tween(legend, “x”, Regular.easeOut, -260.1, 0, 1, true);
legendVis = true;
}
else {
var myTween2:Tween = new Tween(legend, “x”, Regular.easeOut, legend.x, -260.1, 1, true);
legendVis = false;
}
}
var myTween:Tween = new Tween(legend, “x”, Regular.easeOut, legend.x, -260.1, 2, true);
/*myTween.addEventListener(TweenEvent.MOTION_FINISH, doNextTween);
function doNextTween(e:TweenEvent):void {
//trace(“done”);
}*/ //Legend functionality
mapContainer.map.addEventListener(MouseEvent.MOUSE_DOWN, mDrag);
mapContainer.map.addEventListener(MouseEvent.MOUSE_UP, mDragStop);
function mDrag(e:MouseEvent):void {
mapContainer.map.startDrag();
}
function mDragStop(e:MouseEvent):void {
mapContainer.map.stopDrag();
} //Map Functionality
remote.btnZoomIn.addEventListener(MouseEvent.CLICK, mapZoomIn);
remote.btnZoomOut.addEventListener(MouseEvent.CLICK, mapZoomOut);
remote.btnZoomHome.addEventListener(MouseEvent.CLICK, mapZoomHome);
function mapZoomIn(e:MouseEvent):void {
mapContainer.map.scaleX = mapContainer.map.scaleX * 1.2;
mapContainer.map.scaleY = mapContainer.map.scaleX
}
function mapZoomOut(e:MouseEvent):void {
mapContainer.map.scaleX = mapContainer.map.scaleX / 1.2;
mapContainer.map.scaleY = mapContainer.map.scaleX
}
function mapZoomHome(e:MouseEvent):void {
mapContainer.map.scaleX = 1;
mapContainer.map.scaleY = 1;
} //Zoom functionality
remote.v1.selected = true;
remote.v1.addEventListener(MouseEvent.CLICK, v1Toggle);
function v1Toggle(e:MouseEvent):void {
if (remote.v1.selected == true) {
mapContainer.map.path1.visible = true;
}
else {
mapContainer.map.path1.visible = false;
}
}
remote.v2.selected = true;
remote.v2.addEventListener(MouseEvent.CLICK, v2Toggle);
function v2Toggle(e:MouseEvent):void {
if (remote.v2.selected == true) {
mapContainer.map.path2.visible = true;
}
else {
mapContainer.map.path2.visible = false;
}
} //check box functionality
remote.btnPrinter.addEventListener(MouseEvent.CLICK, printMap);
function printMap(e:MouseEvent) {
var myPrintJob:PrintJob = new PrintJob();
myPrintJob.start();
mapContainer.width = 579;
mapContainer.height = 720
//PrintJobOrientation.LANDSCAPE;
myPrintJob.addPage(mapContainer, new Rectangle(0,0,579,720));
//pj.addPage(, new Rectangle(0, 0, sheets.width, sheets.height/2));
myPrintJob.send();
mapContainer.width = 950;
mapContainer.height = 950
} //printer functionality NOT WORKING (print relitive to stage?)
mapContainer.map.hotSpotInfo.btnHotSpotInfo.label = “X”;
mapContainer.map.hotSpotInfo.btnHotSpotInfo.addEventListener(MouseEvent.CLICK, hideHotSpotInfo);
mapContainer.map.hotSpotInfo.visible = false;
mapContainer.map.hotSpotRoll.visible = false;
mapContainer.map.hotSpot.addEventListener(MouseEvent.MOUSE_OVER, hsOver);
mapContainer.map.hotSpot.addEventListener(MouseEvent.MOUSE_OUT, hsOut);
mapContainer.map.hotSpot.addEventListener(MouseEvent.CLICK, hsClick);
function hideHotSpotInfo(e:MouseEvent):void {
mapContainer.map.hotSpotInfo.visible = false;
}
function hsClick(e:MouseEvent):void {
mapContainer.map.hotSpotInfo.visible = true;
mapContainer.map.hotSpotRoll.visible = false;
}
function hsOver(e:MouseEvent):void {
mapContainer.map.hotSpotRoll.visible = true;
}
function hsOut(e:MouseEvent):void {
mapContainer.map.hotSpotRoll.visible = false;
} // hotSpot Functionality
mapContainer.map.starSpotInfo.btnStarSpotURL.addEventListener(MouseEvent.CLICK, openURL);
mapContainer.map.starSpotInfo.visible = false;
mapContainer.map.starSpotRoll.visible = false;
mapContainer.map.starSpot.addEventListener(MouseEvent.ROLL_OVER, ssOver);
mapContainer.map.starSpot.addEventListener(MouseEvent.ROLL_OUT, ssOut);
mapContainer.map.starSpot.addEventListener(MouseEvent.CLICK, ssClick);
mapContainer.map.starSpotInfo.btnStarSpotInfoClose.addEventListener(MouseEvent.CLICK, hideStarInfo);
function openURL(e:MouseEvent):void {
var url:String = “http://stlouis.missouri.org/citygov/parks/forestpark/Lindell.html”;
var request:URLRequest = new URLRequest(url);
navigateToURL(request, ‘_blank’); // second argument is target
}
function hideStarInfo(e:MouseEvent):void {
mapContainer.map.starSpotInfo.visible = false;
}
function ssOver(e:MouseEvent):void {
mapContainer.map.starSpotRoll.visible = true;
}
function ssOut(e:MouseEvent):void {
mapContainer.map.starSpotRoll.visible = false;
}
function ssClick(e:MouseEvent): void {
mapContainer.map.starSpotInfo.visible = true;
mapContainer.map.starSpotRoll.visible = false;
} //starSpot functionality
mapContainer.map.eventSpotInfo.visible = false;
mapContainer.map.eventSpotRoll.visible = false;
mapContainer.map.eventSpot.addEventListener(MouseEvent.ROLL_OVER, esOver);
mapContainer.map.eventSpot.addEventListener(MouseEvent.ROLL_OUT, esOut);
mapContainer.map.eventSpot.addEventListener(MouseEvent.CLICK, esClick);
mapContainer.map.eventSpotInfo.btnEventSpotInfoClose.addEventListener(MouseEvent.CLICK, eshideeventInfo);
function eshideeventInfo(e:MouseEvent):void {
mapContainer.map.eventSpotInfo.visible = false;
}
function esOver(e:MouseEvent):void {
mapContainer.map.eventSpotRoll.visible = true;
}
function esOut(e:MouseEvent):void {
mapContainer.map.eventSpotRoll.visible = false;
}
function esClick(e:MouseEvent): void {
mapContainer.map.eventSpotInfo.visible = true;
mapContainer.map.eventSpotRoll.visible = false;
} //eventSpot funtionality