A RangeError exception is thrown when a numeric value is outside the acceptable range.

Some situations that cause this exception to be thrown include the following:

  • Any OpenFL API that expects a depth number is invoked with an invalid depth number.
  • Any OpenFL API that expects a frame number is invoked with an invalid frame number.
  • Any OpenFL API that expects a layer number is invoked with an invalid layer number.

Constructor

@:value({ message : "" })new(message:String = "")

Inherited Variables

Defined by Error

read onlyerrorID:Int

Contains the reference number associated with the specific error message. For a custom Error object, this number is the value from the id parameter supplied in the constructor.

name:String

Contains the name of the Error object. By default, the value of this property is "Error".

Defined by Exception

read onlymessage:String

Exception message.

read onlynative:Any

Native exception, which caused this exception.

read onlyprevious:Null<Exception>

Contains an exception, which was passed to previous constructor argument.

read onlystack:CallStack

The call stack at the moment of the exception creation.

Inherited Methods

Defined by Error

getStackTrace():String

Returns the call stack for an error at the time of the error's construction as a string. As shown in the following example, the first line of the return value is the string representation of the exception object, followed by the stack trace elements:

TypeError: Error #1009: Cannot access a property or method of a null object reference
	at com.xyz::OrderEntry/retrieveData()[/src/com/xyz/OrderEntry.as:995]
	at com.xyz::OrderEntry/init()[/src/com/xyz/OrderEntry.as:200]
	at com.xyz::OrderEntry()[/src/com/xyz/OrderEntry.as:148]

The preceding listing shows the value of this method when called in a debugger version of Flash Player or code running in the AIR Debug Launcher (ADL). When code runs in a release version of Flash Player or AIR, the stack trace is provided without the file path and line number information, as in the following example:

TypeError: Error #1009: Cannot access a property or method of a null object reference
	at com.xyz::OrderEntry/retrieveData()
	at com.xyz::OrderEntry/init()
	at com.xyz::OrderEntry()

For Flash Player 11.4 and earlier and AIR 3.4 and earlier, stack traces are only available when code is running in the debugger version of Flash Player or the AIR Debug Launcher (ADL). In non-debugger versions of those runtimes, calling this method returns null.

Returns:

A string representation of the call stack.

toString():String

Returns the string "Error" by default or the value contained in the Error.message property, if defined.

Returns:

The error message.

Defined by Exception

details():String

Detailed exception description.

Includes message, stack and the chain of previous exceptions (if set).