PDA

View Full Version : rollOut - sometimes.. strange problem


manitu.hu
01-12-2006, 05:30 PM
I got a strange problem. But maybe known for others.

On a map I had to place several movie-buttons.
When mouse rolls on, a small flag comes up, and on roll-out it should disappear.
But it doesn't sometimes.. (specially if mouse is moved fast)

here's a link, it will be easier to see: http://dev.cbre.hu/index.php?lang=en
(down-right corner click on the grey 'Navigator - search on map' JPG then it comes up in a pop-up - if you choose 2nd or 5th district there are really lot of dots in the next movie, there the problem is unfortunatly obvious..).

all dots and flags are movies in a button.

the code:

on (rollOver) {
gotoAndPlay("mv");
}
on (rollOut) {
play();
}
on (release) {
getURL ($url);
}- this last one is for the data of the URL and the name, it should stay.

has anybody have seen this problem? any solutions on this? (apart from moving the mouse slower..)
should I use something instead of rollOver - rollOut?

Thanks very much for the help..

Siempy
01-12-2006, 06:29 PM
I have seen this problem with my own work as well and I finally decided to use an alternative. Simply use the onEnterFrame function and manually check whether the mouse is over the movieclip (using this._x, this._width and _root._xmouse). Then all you need is a simple boolean variable to remember whether the mouse was over the button before.

flashead
01-12-2006, 06:53 PM
Simply use the onEnterFrame function and manually check whether the mouse is over the movieclip...
Whoa! No don't do that!

Your problem is your rollOut function, it's calling a play(); which will move the playhead if it's stopped, but if its already playing (still playing the rollOver animation), play(); doesn't do anything. Just stick to the gotoAndPlay(); like in your rollOver function, set up another frame label for your rollOut and send it there. ;)

And just cause I'm feeling generous, here's an FLA with the buttons i use in everything. Sans onEnterFrame ;)

Siempy
01-12-2006, 07:21 PM
I seem to have seen a problem where there is none. My apologies :)
Strange to see it did not work too well on my project. Perhaps it was because I was using a movieclip in stead of a button. Well, just forget about it.