Error Messages > Table of 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

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.

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.

An operator is followed by an invalid operand. For example, trace(1+); is syntactically incorrect.

Syntax error

This message is issued whenever a nonspecific syntax error is encountered.

Expected a field name after '.' operator

You must specify a valid field name when using the object.field syntax.

Expected <token>

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)

Initializer list must be terminated by <terminator>

An object or array initializer list is missing the closing ] or }.

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;

The JavaScript '<construct>' 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, switch, try, catch, or throw.

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.

Statement block must be terminated by '}'

A group of statements was declared within curly braces, but the closing brace is missing.

Event expected

An On(MouseEvent) or onClipEvent handler was declared, but no event was specified, or an unexpected token was encountered where an event should appear.

Invalid event

The script contains an invalid mouse or clip event. For a list of valid mouse and clip events, see the On(MouseEvent) and OnClipEvent entries in the ActionScript dictionary chapter.

Key code expected

You need to specify a key code. See Appendix B for a list of key codes.

Invalid key code

The specified key code does not exist.

Trailing garbage found

The script or expression parsed correctly but contained additional trailing characters that could not be parsed

Illegal function

A named function declaration was used as an expression. Named function declarations must be statements.

Valid: function sqr (x) { return x * x; }

Invalid: var v = function sqr (x) { return x * x; }

Function name expected

The name specified for this function is not a valid function name.

Parameter name expected

A parameter (argument) name was expected in a function declaration, but an unexpected token was encountered.

'else' encountered without matching 'if'

An else statement was encountered, but no if appeared before it. You can use else only in conjunction with an if statement.

Scene type error

The scene argument of a gotoAndPlay, gotoAndStop, or ifFrameLoaded action was of the wrong type. The scene argument must be a string constant.

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.

Hexadecimal digits expected after 0x

The sequence 0x was encountered, but the sequence was not followed by valid hexadecimal digits.

Error opening #include file

There was an error opening a file included with the include directive. The error may have occurred because the file was not present or because of a disk error.

Malformed #include directive

An include directive was not written correctly. An include directive must use the following syntax:

#include "somefile.as"

Multi-line comment was not terminated

A multi-line comment started with /*is missing the closing */ tag.

String literal was not properly terminated

A string literal started with an opening quotation mark (single or double) is missing the closing quotation mark.

Function <function> takes <count> parameters

A function was called, but an unexpected number of parameters were encountered.

Property name expected in GetProperty

The getProperty function was called, but the second argument was not the name of a movie clip property.

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.

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.

'on' handlers may not be nested 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.

Statement must appear within on handler

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 onClipEvent handler

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.

Mouse events are permitted only for button instances

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.

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.