PDA

View Full Version : onOut spot event and buttonMode problems...


Mixed
10-24-2007, 02:56 PM
Denis,

I found something interesting.
Let's say I have defined a spot, and with various gfx at mouse over and mouse out. When I click on it, it should load a panorama and hide itself.
The first thing I've noticed, was that at onClick it loads the pano, then disappears ok. But I am also with the mouse over it. So when I move the mouse out, it triggers the onOut event.
Then, I did that onClick to change it's button status to 0, with buttonMode=0. This makes the spot to be unresponsive to the mouse, right? But the thing is... it still does the onOut event once, when I move the mouse out of the spot.
So this is not right. If I disable the buttonmode, even if I'm over the button, then the onOut event should not be triggered!

A possible workaround is to change the onOut behaviour to none, after I disable the button. It works, but I also make the button active again at some point and I need it's original onOut event. And when I have many buttons like this, it's awkward to define the events again.

I hope I was clear enough, if not, then remember that if I disable a button, then all it's events should be disabled immediately, even if my mouse is over the button.

zleifr
10-24-2007, 10:12 PM
You might try setting the spot to visible=0. invisible spots don't trigger events....

Mixed
10-25-2007, 08:24 AM
@zleifr,
I was already using visible property, but it seems that I wasn't using right.
I was doing something like myspot.visible+=1;
Reading the docs I figured out that this use would turn on or off the visibility of my spot. So if now it's 0 then it will be 1, if it is 1 then it will turn to 0.
So I made a function that switches the visibility of a number of spots. But this wasn't working as expected, so I made 2 functions. One to turn visibility to 0 and another one to turn visibility to 1.
Not very nice, but it works.
Still... the issue with onOut event is real, I'd like it fixed ;)