Drawing Class:
private function quitTool():void {
switch (currentTool) {
case "Pencil" :
Pencil.quitTool();
default :
}
}
Pencil Class:
private var currentColor:uint;
private var board:Layer;
public function Pencil(currentColor, board:Layer) {
this.currentColor = currentColor;
this.board = board;
board.addEventListener(MouseEvent.MOUSE_DOWN, startPencil);
board.addEventListener(MouseEvent.MOUSE_UP, stopPencil);
}
public static function quitTool() {
board.removeEventListener(MouseEvent.MOUSE_DOWN,startPencil);
}
I keep getting error 1120. Access of undefined properties for both board and pencil. They do exist because the only time the function runs is when the currentTool is that tool therefore has been created.
I’m sort of new to OOP and not very familiar with the word static. Without it there was this error:
1061: Call to a possibly undefined method quitTool through a reference with static type Class.
Thanks for whoever takes the time. Not only will this help me with my project but will also help me understand OOP better.