Say we have this function, missing the start { after the void
13: function onMouseUpEvent(evt:MouseEvent):void
14: this.drawing = false;
15: stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMoveEvent);
16: }
You will get a compile time error saying that the problem is around line 16. when really it's on line 13. Here's the correct code.
<code>
13: function onMouseUpEvent(evt:MouseEvent):void {
14: this.drawing = false;
15: stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMoveEvent);
16: }
</code>
{ 2 comments… read them below or add one }
This can also occur if–as i did–one accidentally creates a function and variable name starting with an illegal character, e.g., a digit (0-9). I should have known better at my level of experience, but the compiler should have known better, too.
thanks for the contribution Kirk! I’ve hit that snag before too working with KeyCodes