That is the full code for the pan... Really, that's everything (except the line that imports the needed libraries, I guess). No variables, nothing else. MainMap is the movie clip I'm trying to pan, it's an imported .ai file of a map, so I already have a zoom in place using TweenLite and relative values as well as a legend and a detail that you can open and close (only close is functional right now). I'll paste my full code below:
import fl.video.VideoEvent;
import fl.controls.Button;
import flash.display.*;
import flash.events.*;
import com.greensock.*;
stop();
DowntownInstance.visible=false;
DowntownClose.visible=false;
LegendClose.addEventListener(MouseEvent.CLICK,LegendCloser);
function LegendCloser(event_object:MouseEvent) {
LegendInstance.visible=false;
LegendClose.visible=false;
}
DowntownClose.addEventListener(MouseEvent.CLICK,DowntownCloser);
function DowntownCloser(event_object:MouseEvent) {
DowntownInstance.visible=false;
DowntownClose.visible=false;
}
ZoomIn.addEventListener(MouseEvent.CLICK,ZoomInFunction);
function ZoomInFunction(event_object:MouseEvent) {
TweenLite.to(MainMap,1,{scaleX:".35",scaleY:".35"});
}
ZoomOut.addEventListener(MouseEvent.CLICK,ZoomOutFunction);
function ZoomOutFunction(event_object:MouseEvent) {
TweenLite.to(MainMap,1,{scaleX:"-.35",scaleY:"-.35"});
}
//dragging map around functions
MainMap.addEventListener(MouseEvent.MOUSE_DOWN,
beginDrag);
function beginDrag(e:MouseEvent):void {
stage.addEventListener(MouseEvent.MOUSE_MOVE,moveMC);
stage.addEventListener(MouseEvent.MOUSE_UP,endDrag);
}
function endDrag(e:MouseEvent):void {
stage.removeEventListener(MouseEvent.MOUSE_MOVE,moveMC);
stage.removeEventListener(MouseEvent.MOUSE_UP,endDrag);
}
function moveMC(e:MouseEvent):void {
TweenLite.to(MainMap,.5,{x:mouseX,y:mouseY});
e.updateAfterEvent();
}