PDA

View Full Version : Weird values of _xmouse and _ymouse


hayored
12-15-2002, 04:07 PM
I am testing the values of _xmouse and _ymouse. Here is my function:
function find_xy() {
var xVar = _root._xmouse ;
var yVar = _root._ymouse ;
x.text = xVar ;
y.text = yVar ;
}

On some part of the screen the displayed value is nnn.95 (nnn looks like a correct number). Why this .95 and not an integer value?

Thanks,

YH

jubei
12-15-2002, 10:49 PM
I'm not sure why it does that (sorry.. maybe it's just a bug?) but if you want it to stop, just put the variable in Math.ceil ()

So you might have

function find_xy() {
var xVar = _root._xmouse ;
var yVar = _root._ymouse ;
x.text = Math.ceil (xVar) ;
y.text = Math.ceil (yVar) ;
}

That'll round them up.

hayored
12-15-2002, 11:00 PM
Well, I use the results as it comes with .95 value and my program is working OK. I thought the is a special meaning for this .95.

YH