Sometimes you see maps that show you another map layout when you hover over using the mouse.
To do this on static images is very easy and because of the toolbox it is possible as well on dynamic maps.
This example shows you such an implementation.
Look at the following print screen. In the time line you will see 4 different layers (buttons,shadow,backmap and front). The shadow layer is set as "Mask" what means that everyting drawn on this layer will be cut out and visible of what lays under it. (In this case background). On this layer I put a movie clip that has a simple circle draw into it.
Inside the "circle" movie clip I entered the following code. This code ensures that the circle is following the mouse when the map interaction is set to select. This is the only code you need to write to get this effect!!
onMouseMove = function() {
if (_root.m.interaction == 'select') {
// -50 because the cricle diameter is 100
this._x = this._parent._xmouse-50;
this._y = this._parent._ymouse-50;
} else {
// put the circle back on it's place
if (this._x != 134.3 && this._y != 315.0) {
this._x = 134.3;
this._y = 315.0;
}
}
}
The front layer has the first map that you user can see all the time, the background map is the map that is hidden by the mask. For the rest there is no code to be entered. Simple hook up the components using the properties. You can find the sample code on the left of the window.