Hi.
I am having this simple problem which I hope some of you can help me with.
I’ve written a small program which detects my mouse movement and draws circles on the x- and y-position of the mouse.
code:
function drawCircle(event:MouseEvent){
graphics.lineStyle(2, 0, 1);
if(event.buttonDown){
graphics.beginFill(0x000000, 1);
} else {
graphics.beginFill(0xFFFFFF, 1);
}
graphics.drawCircle(mouseX, mouseY, 40);
graphics.endFill();
}
stage.addEventListener(MouseEvent.MOUSE_MOVE, drawCircle);
As you can probably see: after drawing a lot of circles the program slows down and the framerate makes the circles be placed with a large gap between them. I would guess that the program draws what is behind the current circle even though the user cannot see it?
Can anyone tell me of a way to get past this? I can’t seem to find a solution.
Thanks for your time.