all groups > flash actionscript > february 2006 >
You're in the

flash actionscript

group:

_xmouse / _ymouse annoyance


Re: _xmouse / _ymouse annoyance David Stiller
2/3/2006 5:29:36 PM
flash actionscript: sneskid,

[quoted text, click to view]

Why should it be an integer, necessarily? Flash is measures in twips,
which are 1/20th of a pixel.

[quoted text, click to view]

ActionScript is presumably just telling you where your mouse is. :) If
you want integers, you can use any of the static Math methods, such as
round(), floor, and ceil().


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

Re: _xmouse / _ymouse annoyance David Stiller
2/3/2006 6:07:33 PM
sneskid,

[quoted text, click to view]

You'd be amazed how many obvious solutions aren't obvious in these
forums, sometimes. I didn't mean anything by it except to help. :)

[quoted text, click to view]

Flash handles movement down to the twip, so it just doesn't surprise me
that _xmouse and _ymouse return non-integers.


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

Re: _xmouse / _ymouse annoyance David Stiller
2/3/2006 9:23:44 PM
sneskid,

[quoted text, click to view]

The result *is* in pixels. But the fractional pixels are, I'm guessing,
twips. I couldn't swear to that, but that's my hunch.

I'm sorry you're frustrated by it, but in this case, you can get
integers so easily. I don't see why you let it bother you.


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

_xmouse / _ymouse annoyance sneskid
2/3/2006 10:02:05 PM
have a look at and click around on
http://www.finalstop.ca/mouse.html

it's really simple, just a 640x480 area it shows you the x/y where the mouse
was clicked. When clickin in the lower left regions (which produces higher x
and y values) notice how you get ".95" at the end of the number, but the result
should be a fully rounded integer. The movie is at a 1:1 scale with the screen.

Is this CPU specific, or just somthing that happens in numeric calculations
Flash?
Re: _xmouse / _ymouse annoyance sneskid
2/3/2006 10:52:00 PM
im not concerned about how to get around it, obviously i can just round it up.
Re: _xmouse / _ymouse annoyance sneskid
2/3/2006 11:57:44 PM
8199 twips = 409.95 pixels (this is when the "annomally" starts)


I think twips are quite pointless.. we should be able to choose the unit in
such cases..

The help usually provides a detailed explanation as to what is being returned,
it should mention _xmouse and _ymouse are in twips.

Thanks for your help
Re: _xmouse / _ymouse annoyance DGcoder
2/4/2006 8:35:58 PM
AddThis Social Bookmark Button