Hi,
I am working with a map pan thing atm. I have uploaded it here: http://megaswf.com/serve/79198/
Now it works for that specific city but I want to have the focus changed to different cities when button for that city is clicked and after trying for the last 4 days I am unable to figure out how to do it. My image/map is way larger than the stage and thats where I am getting a problem and unable to solve it.
I would have uploaded the fla file but it longer than the required limit allowed here so if that is needed I can upload it on a 3rd party software.
Here is the as3 code(code is a little messy atm)
stop();
myImage1.mask=myMask1;
import fl.transitions.Tween;
import fl.transitions.easing.*;
var xScaleT:Tween = new Tween(myMask1, "x", Strong.easeOut, 0, myMask1.x, 3, true);
var yScaleT:Tween = new Tween(myMask1, "y", Strong.easeOut, 0, myMask1.y, 3, true);
var clickPoint1:Point = new Point();
var sboundsX:Number=myImage1.globalToLocal(clickPoint1).x-50;
var sboundsY:Number=myImage1.globalToLocal(clickPoint1).y+50;
var boundsX:Number=myImage1.globalToLocal(clickPoint1).x+1500;
var boundsY:Number=myImage1.globalToLocal(clickPoint1).y+835;
trace(myImage1.x);
trace(myImage1.y);
myImage1.addEventListener(MouseEvent.MOUSE_DOWN, startdrag);
myImage1.addEventListener(MouseEvent.MOUSE_UP, stopdrag);
bk.addEventListener(MouseEvent.MOUSE_DOWN, goback);
function goback(event:MouseEvent):void{
gotoAndPlay(1);
}
function startdrag(event:MouseEvent):void{
var bounds:Rectangle = new Rectangle(sboundsX,sboundsY,boundsX,boundsY);
//var bounds:Rectangle = new Rectangle(-343,-145,1257,649);
myImage1.startDrag(false,bounds);
var clickPoint:Point = new Point(myImage1.mouseX, myImage1.mouseY);
trace("display object coordinates:", clickPoint);
trace("stage coordinates:", myImage1.globalToLocal(clickPoint));
}
function stopdrag(event:MouseEvent):void{
myImage1.stopDrag();
}
function stopdrag1():void{
myImage1.stopDrag();
}
To be honest I just played around and this were the perfect bounds I am getting var bounds:Rectangle = new Rectangle(-343,-145,1257,649);. I dont know how to get those dynamically.
And help will be really appreciated or any other links showing something similar will be a great help as well
Thanks in advance.