Flash Menu

Hello!
Here’s my first post in kirupa.com
I have a flash menu (125 px x 600 px) on the left of a webpage.
It consists of (15) buttons each of them havin’ a onMouseOver–>getURL.
When the mouse enters the flash movie (that is the menu) there is a mask
button that moves along the y axis and when you move to a button in the menu the mask moves to that point. When you click on it it opens the URL in your browser.
Now the problem is that when you leave the flash movie (menu) I want the mask to go to the upper part of the movie (menu).How can I do that?
Thanx in advance for your help!

WELCOME!

flash has no ‘real’ way of knowing when the mouse is within the movie or not. There are a couple of ways to do what you want though.

One way is to check for mouse movement. When your mouse leaves a flash movie, flash thinks of the mouse as being where it was the last time your mosue was over it - depening on how fast you moved your mouse on leaving, most likely by some edge of the movie. Checking to see if the mouse hasnt moved in a certain amount of time can give you a fairly indication of whether or not the mouse is in the movie (that or maybe someone is just reading and resting their mouse in one position, in which case the menu wont be needed anyway and can be moved back up). Sample script would be like

this.onMouseMove = function(){
mousetimer = 0;
}
this.onEnterFrame = function(){
if (mousetimer++ > 500){
//move mask back up
}
}

this can be done with an onEnterFrame or setInterval - just some method of counting over time increasing the mousetimer variable. 300 represents the wait. When the mouse moves, it resets it back to 0 and the count starts over again.

A more common method that, as I have heard (though not seen), is not completely cross-platform, is using a button to cover the entire flash movie and detecting a rollOut with that button. A button has the ability to see if the mouse is over it or not no matter where the mouse is, whether it be in the flash movie or off. Now since you are dealing with a menu of buttons, youd probably have to include a check for all the buttons since you wouldnt want this ‘isOnFlash’ checking button but cover up their actions. The basic concept there is:

mouseInFlashButton.onRollOut = function(){
//mouse is out of flash
}
mouseInFlashButton.onRollOver = function(){
// mouse is in flash
}

Alternatively, you can use javascript to check the position of of your mouse and check to see if it is in the flash movie or not. Here is an example script showing mouse position detection in javascript:
CLICK
(note the statusbar)

I have a MC on the root called mask. I have a button on the root as well. The onRollout for the button is to call the function moveMe() on the root.
I have put

On(rollOut){
_root.dockMe();
}
in the Actions in the MC mask and the function in the Actions layer in the first frame of the timeline but when i preview the swf the Output window shows me the following:

Symbol=mask, Layer=Layer 1, Frame=1: Line 1: Clip events are permitted only for movie clip instances
onClipEvent (mouseMove) {

Scene=Scene 1, Layer=mask, Frame=1: Line 1: ‘;’ expected
On(rollOut){

Any help?