Dave New
Dave New

Reputation: 40092

TypeError when creating new array

The following line of code sometimes throws an exception:

var stopScheduleItems:Array = [];

The exception being thrown:

TypeError: Error #1010: A term is undefined and has no properties.

I cannot understand why this could happen when creating a new array. Could anyone provide some insight. Thanks

Upvotes: 0

Views: 55

Answers (1)

Gio
Gio

Reputation: 1954

This line can't be throwing this error.

It's more likely that you are trying to access a method of the stopScheduleItems object before it's defined. For example something like this:

stopScheduleItems.pop();
var stopScheduleItems:Array = [];

Upvotes: 1

Related Questions