Hi,
I am trying to make this an kinda interactive map in flash. I will try to explain it for better explanation. Here is an image of the output
I have a jpg image(converted to movieclip) which is way larger than the stage.
Stage: 550*400
Image height:835
Image Width:1500
Then I have a mask in the center of the stage and user sees a portion of the map and is allowed to scroll to move mouse around to see areas around the focused city.
Here is the code:
stop();
myImage1.mask=myMask1;
myImage1.addEventListener(MouseEvent.MOUSE_DOWN, startdrag);
myImage1.addEventListener(MouseEvent.MOUSE_UP, stopdrag);
function startdrag(event:MouseEvent):void{
var bounds:Rectangle = new Rectangle(-343,-145,1257,649);
myImage1.startDrag(false,bounds);
}
function stopdrag(event:MouseEvent):void{
myImage1.stopDrag();
}
***My question is what are the numbers in
var bounds:Rectangle = new Rectangle(-343,-145,1257,649);
I put this numbers in by playing around but where are these values exactly coming from. I have tried everything(every possible way) but cant figure out what are these values. I need to numbers to be dynamic so I can change the focus to different cities(for example when a user click A city A should be seen inside the mask and so on).
How can I make these values dynamic instead of hard coding them.
I hope I tried to make this as clear as possible. I myself is confused. So if needed I will upload the code.
Thanks in advance.
Best Regards,
Adeel Abbas