When tracing coordinates mouseX / mouseYor a localX / localYdisplay object, why does it xstart at 1, but ystarts at 0?
for example, I drew a simple 400 x 400 pixel script on the scene using an event listener MouseEvent.MOUSE_MOVEthat calls a handler function to track the local coordinates of the mouse.
the first, upper left pixel returns {x:1, y:0}, and the last, right right pixel returns {x:400, y:399}. We should not begin and end x, and ywith the same meaning? I'm not sure what makes sense for the first coordinate of the mouse (0 or 1), but of course it doesn't make sense that they are different?
[SWF(width = "1000", height = "600", backgroundColor = "0xCCCCCC")]
import flash.display.Sprite;
import flash.events.MouseEvent;
var darkBlueRect:Sprite = createSprite();
darkBlueRect.x = 23;
darkBlueRect.y = 42;
addChild(darkBlueRect);
darkBlueRect.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveEventHandler);
function mouseMoveEventHandler(evt:MouseEvent):void
{
trace(darkBlueRect.mouseX, evt.localX, darkBlueRect.mouseY, evt.localY);
}
function createSprite():Sprite
{
var result:Sprite = new Sprite();
result.graphics.beginFill(0x0000FF, 0.5);
result.graphics.drawRect(0, 0, 400, 400);
result.graphics.endFill();
return result;
}