Sliding Mask on the Map


I am trying to make something like this :
A flash movie with the dimension 400 X 400.
I have made two movieclips says “Map” which is 800 X 800 and another “mask” which is 100 X 100.
I have placed the “Map” movieclip on the stage on one layer and the “mask” movieclip on the other layer. I gave mask action to the map layer so now i can just view 100 X 100 area of the “Map” on the stage.

I have given the following action on the frame :
startDrag(“mask”, true, 0, 0, 800, 800);

so that the mask will move with the movie on the stage.

Now the problem which i m facing is : I dont want to resize the movie according the window size and also i dont need scroll bars, i want to publish it in the size 400X400, so what happens is that i can just move the “mask” into this much area and as the “Map” movieclip is 800 X 800 hence i cant see the right and bottom part of “Map”.

Hence now what i would like to have is that when i move the “mask” from left to right the “Map” movie clip should move below it from right to left upto its width and the right end of the stage and vice versa. In the same manner when i move the “mask” from top to bottom the “Map” movie clip should move from bottom to top upto its height and the bottom end of the stage and vice versa.

If anyone can help me doing this then i would really appreciate it.