# Error Messages

### Table of error messages

The following table contains a list of error messages returned by the Flash compiler. An explanation of each message is provided to aid you in troubleshooting your movie files.

Error message | Description
--- | ---
'on' handlers may not nest within other 'on' handlers | An on handler was declared inside another `on` handler. All `on` handlers must appear at the top level of an action list.
'onClipEvent' handlers may not nest within other 'onClipEvent' handlers | An onClipEvent handler was declared inside another onClipEvent handler. All onClipEvent handlers must appear at the top level of an action list.
<token> Expected | An invalid or unexpected token was encountered. For example, in the syntax below, the token `foo` is not valid. The expected token is `while.``do {``trace (i)``} foo (i < 100)`
1 Classes may only be defined in package scripts. |
10 All member functions need to have names. |
11 This statement is not permitted in a class definition. |
12 A class or interface has already been defined with this name. |
13 Type mismatch. |
14 There is no class with this name. |
15 There is no property with the name ' '. |
16 A function call on a non-function was attempted. |
17 Type mismatch in assignment statement. |
18 The member is private and cannot be accessed. |
19 Variable declarations are not permitted in interfaces. |
2 Interfaces may only be defined in package scripts. |
20 Event declarations are not permitted in interfaces. |
21 Private members are not permitted in interfaces. |
22 Function bodies are not permitted in interfaces. |
23 A class may not extend itself. |
24 An interface may not extend itself. |
25 There is no interface defined with this name. |
26 A class may not extend an interface. |
27 An interface may not extend a class. |
28 An interface name is expected after the 'implements' keyword. |
29 A class may not imlement a class, only interfaces. |
3 Packages may only define class constructs. |
30 The class must implement method ' ' from interface ' '. |
31 The implementation of an interface method must be a method, not a property. |
32 A class may not extend the same interface more than once. |
33 The implementation of the interface method doesn't match its definition. |
34 This construct is only available in ActionScript 1.0. |
35 This construct is only available in ActionScript 2.0. |
36 Static members are not permitted in interfaces. |
37 The expression returned must match the function's return type. |
38 A return statement is required in this function. |
39 Attribute used outside class. |
4 The name used to define this class is invalid. |
40 A function with return type Void may not return a value. |
41 The 'extends' clause must appear before the 'implements' clause. |
42 A type identifier is expected after the ':'. |
43 Interfaces must use the 'extends' keyword, not 'implements'. |
44 A class may not extend more than one class. |
45 An interface may not extend more than one interface. |
46 There is no method with the name ' '. |
47 This statement is not permitted in an interface definition. |
48 A set function requires exactly one parameter. |
49 A get function requires no parameters. |
5 The specified package could not be loaded. |
50 Classes may only be defined in package scripts. |
51 Packages may only define class or interface constructs. |
52 The name used to define this class is invalid. |
53 The specified package could not be loaded. |
54 Interfaces may only be defined in package scripts. |
55 Instance variables cannot be accessed in static functions. |
56 Class and interface definitions cannot be nested. |
57 The property being references does not have the static attribute. |
58 This call to super does not match the superconstructor. |
59 Only the public attribute is allowed for interface methods. |
6 A class name was expected. |
60 The import keyword cannot be used as a directive. |
61 A class must have only one constructor. |
62 A constructor may not return a value. |
63 A constructor may not specify a return type. |
64 A variable may not be of type Void. |
65 A function parameter may not be of type Void. |
66 Static members cannot be assigned from instances. |
67 Multiple implemented interfaces contain same method with different types. |
68 There is already a class or interface defined with this name. |
69 Classes, interfaces, and built-in types may not be deleted. |
7 A base class name is expected after the 'extends' keyword. |
70 There is no package or class with this name. |
71 The keyword ' ' is reserved for ActionScript 2.0 and cannot be used here. |
72 The class being compiled, '<className>', does not match the class that was imported, '<className>'. |
8 A member attribute was used incorrectly. |
9 The same member name may not be repeated more than once. |
Case statements can only be used inside a switch statement | Case statements must be used inside of switch statements.
Case statements must be terminated with a ':' | Every case statement within a switch statement must end with a colon.
Case-insensitive identifier <identifier> will obscure built-in object <object name> | Since ActionScript is case-insensitive, a case-insensitive identifier would obscure a built-in object.
Clip events are permitted only for movie clip instances | A clip event handler was declared in a frame action list or a button instance's action list. Clip events are permitted only in the action lists of movie clip instances.
Duplicate in event list | An on handler was specified with a duplicate event.
'else' encountered without matching 'if' | An `else` statement was encountered, but no `if` statement appeared before it. You can use `else` only in conjunction with an `if` statement.
Error opening include file:file not found | There was an error opening a file included with the `include` directive. The file was not present.
Event expected | An `on(MouseEvent)` handler was declared, but no event was specified, or an unexpected token was encountered where an event should appear.
Expected a field name after '.' operator | You must specify a valid field name when using the `object.field` syntax.
Function declaration not permitted here | Cannot use a named function when declaring it in an assignment.
Function name expected | The name specified for this function is not a valid function name.
Hexadecimal digits expected after 0x | The sequence `0x` was encountered, but the sequence was not followed by valid hexadecimal digits.
Identifier expected | An unexpected token was encountered in place of an identifier. In the example below, 3 is not a valid identifier.`var 3 = 4;`
Initializer list must be terminated by <terminator> | An object or array initializer list is missing the closing ] or }.
Internal error | An internal error occurred in the ActionScript compiler. Please send the FLA file that generated this error to Macromedia, with detailed instructions on how to reproduce the message.
Invalid key code | The specified key code does not exist.
Invalid mouse event specified | The script contains an invalid mouse event in a handler. For a list of valid mouse events, see the `On(MouseEvent)` entry in the online ActionScript Dictionary.
Invalid movie clip event specified | An `onClipEvent` handler can only accept `load`, `enterForm`, `unload`, `mouseMove`, `mouseDown`, `mouseUp`, `keyDown`, `keyUp`, or `data` events.
Key code identifier expected | You need to specify a key code. See Appendix B for a list of key codes.
Left side of assignment operator must be variable or property | An assignment operator was used, but the left side of the assignment was not a legal variable or property.
Malformed #include directive | An `include` directive was not written correctly. An `include` directive must use the following syntax: `#include "somefile.as"`
Mouse events are permitted only for button instances (Message appears for Flash 5 format) | A button event handler was declared in a frame action list or a movie clip instance's action list. Button events are permitted only in the action lists of button instances.
Multi-line comment was not terminated | A multi-line comment started with `/*` is missing the closing `*/` tag.
Operator <operator> must be followed by an operand | An operator without an operand was encountered. For example, `x = 1 +` requires an operand after the `+` operator.
Parameter <parameter> cannot be declared multiple times | A parameter name appeared multiple times in the parameter list of a function declaration. All parameter names must be unique.
Parameter name expected | A parameter (argument) name was expected in a function declaration, but an unexpected token was encountered.
Property <property> does not exist | A property that does not exist was encountered. For example,`x = _green` is invalid, because there is no `_green` property.
Property name expected in getProperty | The `getProperty` function was called, but the second parameter was not the name of a movie clip property.
Scene name must be a quoted string | The scene argument of a `gotoAndPlay`, `gotoAndStop`, or `ifFrameLoaded` action was of the wrong type. The scene argument must be a string constant.
Statement block must be terminated by '}' | A group of statements was declared within curly braces, but the closing brace is missing.
Statement must appear within on handler (Message appears for Flash 5 format) | In the actions for a button instance, a statement was declared without a surrounding `on` block. All actions for a button instance must appear inside an `on` block.
Statement must appear within on or onClipEvent handler (Message appears for Flash MX format) | In the actions for a movie clip instance, a statement was declared without a surrounding on or `onClipEvent` block. All actions for a movie clip instance must appear inside an on or `onClipEvent` block.
Statement must appear within onClipEvent handler (Message appears for Flash 5 format) | In the actions for a movie clip instance, a statement was declared without a surrounding `onClipEvent` block. All actions for a movie clip instance must appear inside an `onClipEvent` block.
String literal was not properly terminated | A string literal started with an opening quotation mark (single or double) is missing the closing quotation mark.
Syntax error | This message is issued whenever a nonspecific syntax error is encountered.
The JavaScript 'void' construct is not supported | A JavaScript construct that is not supported by ActionScript was encountered. This message appears if any of the following JavaScript constructs are used: `void`, `try`, `catch`, or `throw`.
Trailing garbage found | The script or expression parsed correctly but contained additional trailing characters that could not be parsed.
Variable <variable> cannot be declared multiple times | A variable name appeared multiple times in a `var` statement. All variable names in a single `var` statement must be unique.
Wrong number of parameters; <function> requires between <low> and <high> | A function was called, but an unexpected number of parameters were encountered.