function brushOn(thisMouse:MouseEvent) {
if (thisMouse.buttonDown) {
grid.addEventListener(Event.ENTER_FRAME,painter);
} else {
grid.removeEventListener(Event.ENTER_FRAME,painter);
}
}
function painter(e:Event) {
var thisX:Number=Math.floor(grid.mouseX/10);
var thisY:Number=Math.floor(grid.mouseY/10);
editMap[thisY][thisX][0].gotoAndStop(chooserTile.currentFrame);
editMap[thisY][thisX][1]=chooserTile.currentFrame;
editMap[thisY][thisX][2]=true;
**if (thisMouse.shiftKey) {**
editMap[thisY][thisX][0].bound.alpha=1;
editMap[thisY][thisX][2]=false;
}
}
grid.addEventListener(MouseEvent.MOUSE_DOWN,brushOn);
grid.addEventListener(MouseEvent.MOUSE_UP,brushOn);
I used to actuate the painter function by using a MouseEvent although I’m prefering to do it this way, but I’m having issues with an error “1120: Access of undefined property thisMouse.”
Error in Bold
I’ve attempted to pass the Mouse Event to the painter function but had no luck.
A simple solution (even potentially dangerous and WRONG) would be fine here, as this is part of University Coursework and I haven’t been taught Classes etc. Its basically an introduction to scripting but im trying to do things slightly out of my depth