So what's the catch?
The animation only works if the user scrolls off of the button onto an area of the movie. This means that if your button is up against the side of the movie and the user scrolls of the button to an area that is not part of the movie the button will remain in the up position until the mouse is returned to the stage. In the example below you will notice that if you rollover the button to the right, off of the movie itself, the button remains in the up position whereas if you rollout to any area on the rest of the movie it works fine:
The reason for this lies in the _root._xmouse and _root._ymouse part of the code. Those two functions return the position of the mouse when the mouse is over the movie. As soon as the user scrolls out of the movie the functions freeze on the last known coordinates of the mouse. So if the last known coordinates of the mouse were over our movie clip button then movie considers the mouse as still being there.
Which means that if you wanted the "button" to be the same size as the movie, so that you could make all your buttons in this fashion and then bring them into another program such as dreamweaver, they wont animate back at all. That is why this section is called "Buttons for sites entirely in flash". If you want to know how to make them work and be the same size as the stage then continue on to the next section.
|» Level Intermediate|
Rating: 8 Votes: 119
|Freelance flash designer.|
|Download the files used in this tutorial.|
|Download (59 kb)|
|More help? Search our boards for quick answers!|