Method | Defined By | ||
---|---|---|---|
MemoryError(message:String = "") Creates a new MemoryError object. | MemoryError | ||
![]() | Returns the call stack for an error at the time of the error's construction as a string. | Error | |
![]() | Indicates whether an object has a specified property defined. | Object | |
![]() | Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object | |
![]() | Indicates whether the specified property exists and is enumerable. | Object | |
![]() | Sets the availability of a dynamic property for loop operations. | Object | |
![]() | Returns the string representation of this object, formatted according to locale-specific conventions. | Object | |
![]() | [override] Returns the string "Error" by default or the value contained in the Error.message property, if defined. | Error | |
![]() | Returns the primitive value of the specified object. | Object |
MemoryError | () | Constructor |
package { import flash.display.Sprite; import flash.errors.MemoryError; import flash.utils.setInterval; public class MemoryErrorExample extends Sprite { private var crashingStr:String; private var intervalId:Number; public function MemoryErrorExample() { crashingStr = "abcdefghijklmnopqrstuvwxyz"; intervalId = setInterval(exhaustMemory, 50); } public function exhaustMemory():void { try { crashingStr += crashingStr; } catch(e:MemoryError) { trace(e); } } } }