#

API Documentation for: NEXT
Show: Inherited Protected Private Deprecated

# Sprite Class

Extends DisplayObject
Defined in: `Sprite:39`
Module: EaselJS

Displays a frame or sequence of frames (ie. an animation) from a SpriteSheet instance. A sprite sheet is a series of images (usually animation frames) combined into a single image. For example, an animation consisting of 8 100x100 images could be combined into a 400x200 sprite sheet (4 frames across by 2 high). You can display individual frames, play frames as an animation, and even sequence animations together.

See the SpriteSheet class for more information on setting up frames and animations.

#### Example

     var instance = new createjs.Sprite(spriteSheet);
     instance.gotoAndStop("frameName");

Until gotoAndStop or gotoAndPlay is called, only the first defined frame defined in the sprite sheet will be displayed.

## Constructor

### `Sprite`

(

- `spriteSheet`
- `[frameOrAnimation]`

)

Defined in `Sprite:39`

#### Parameters:

- `spriteSheet` SpriteSheet

  The SpriteSheet instance to play back. This includes the source image(s), frame dimensions, and frame data. See SpriteSheet for more information.

- `[frameOrAnimation]` String | Number optional

  The frame number or animation to play initially.

- Index
- Methods
- Properties
- Events

## Item Index

### Methods

- _applyFilterBounds
- _applyFilters
- _applyShadow
- _dispatchEvent
- _getBounds
- _goto
- _isMouseOpaque
- _normalizeFrame
- _testHit
- _tick
- _transformBounds
- addEventListener
- advance
- cache
- clone
- cloneProps
- dispatchEvent
- draw
- getBounds
- getCacheDataURL
- getConcatenatedMatrix
- getMatrix
- getStage
- getTransformedBounds
- globalToLocal
- gotoAndPlay
- gotoAndStop
- hasEventListener
- hitTest
- initialize
- isVisible
- localToGlobal
- localToLocal
- off
- on
- play
- removeAllEventListeners
- removeEventListener
- set
- setBounds
- setTransform
- stop
- toString
- uncache
- updateCache
- updateContext
- willTrigger

### Properties

- _advanceCount
- _animation
- _animation
- _bounds
- _cacheDataURL
- _cacheDataURLID
- _cacheOffsetX
- _cacheOffsetY
- _cacheScale
- _captureListeners
- _dispatchAnimationEnd
- _listeners
- _matrix
- _rectangle
- alpha
- cacheCanvas
- cacheID
- compositeOperation
- currentAnimation
- currentAnimationFrame
- currentFrame
- cursor
- DisplayObject__tick
- DisplayObject_cloneProps
- DisplayObject_draw
- DisplayObject_getBounds
- DisplayObject_initialize
- filters
- framerate
- hitArea
- id
- mask
- mouseEnabled
- name
- offset deprecated
- onAnimationEnd deprecated
- onClick deprecated
- onDoubleClick deprecated
- onMouseOut deprecated
- onMouseOver deprecated
- onPress deprecated
- onTick deprecated
- parent
- paused
- regX
- regY
- rotation
- scaleX
- scaleY
- shadow
- skewX
- skewY
- snapToPixel
- spriteSheet
- tickEnabled
- visible
- x
- y

### Events

- animationend
- click
- dblclick
- mousedown
- mouseout
- mouseover
- pressmove
- pressup
- rollout
- rollover
- tick

## Methods

### `_applyFilterBounds`

(

- `x`
- `y`
- `width`
- `height`

)
Rectangle protected

Inherited from DisplayObject: `_applyFilterBounds:1281`

#### Parameters:

- `x` Number
- `y` Number
- `width` Number
- `height` Number

#### Returns:

Rectangle:

### `_applyFilters`

() protected

Inherited from DisplayObject: `_applyFilters:1266`

### `_applyShadow`

(

- `ctx`
- `shadow`

)
protected

Inherited from DisplayObject: `_applyShadow:1218`

#### Parameters:

- `ctx` CanvasRenderingContext2D
- `shadow` Shadow

### `_dispatchEvent`

(

- `eventObj`
- `eventPhase`

)
protected

Inherited from EventDispatcher: `_dispatchEvent:369`

#### Parameters:

- `eventObj` Object | String | Event
- `eventPhase` Object

### `_getBounds`

(

- `matrix`
- `ignoreTransform`

)
Rectangle protected

Inherited from DisplayObject: `_getBounds:1307`

#### Parameters:

- `matrix` Matrix2D
- `ignoreTransform` Boolean

  If true, does not apply this object's transform.

#### Returns:

Rectangle:

### `_goto`

(

- `frameOrAnimation`
- `[frame]`

)
protected

Defined in `_goto:478`

Moves the playhead to the specified frame number or animation.

#### Parameters:

- `frameOrAnimation` String | Number

  The frame number or animation that the playhead should move to.

- `[frame]` Boolean optional

  The frame of the animation to go to. Defaults to 0.

### `_isMouseOpaque`

() Boolean protected

Inherited from DisplayObject: `_isMouseOpaque:1351`

Indicates whether the display object has any mouse event listeners or a cursor.

#### Returns:

Boolean:

### `_normalizeFrame`

() protected

Defined in `_normalizeFrame:391`

Normalizes the current frame, advancing animations and dispatching callbacks as appropriate.

### `_testHit`

(

- `ctx`

)
Boolean protected

Inherited from DisplayObject: `_testHit:1249`

#### Parameters:

- `ctx` CanvasRenderingContext2D

#### Returns:

Boolean:

### `_tick`

(

- `props`

)
protected

Inherited from DisplayObject but overwritten in `_tick:376`

Advances the `currentFrame` if paused is not true. This is called automatically when the Stage ticks.

#### Parameters:

- `props` Object

  Properties to copy to the DisplayObject DisplayObject/tick event object.

### `_transformBounds`

(

- `bounds`
- `matrix`
- `ignoreTransform`

)
Rectangle protected

Inherited from DisplayObject: `_transformBounds:1318`

#### Parameters:

- `bounds` Rectangle
- `matrix` Matrix2D
- `ignoreTransform` Boolean

#### Returns:

Rectangle:

### `addEventListener`

(

- `type`
- `listener`
- `[useCapture]`

)
Function | Object

Inherited from EventDispatcher: `addEventListener:142`

Adds the specified event listener. Note that adding multiple listeners to the same function will result in multiple callbacks getting fired.

#### Example

     displayObject.addEventListener("click", handleClick);
     function handleClick(event) {
        // Click happened.
     }

#### Parameters:

- `type` String

  The string type of the event.

- `listener` Function | Object

  An object with a handleEvent method, or a function that will be called when the event is dispatched.

- `[useCapture]` Boolean optional

  For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase.

#### Returns:

Function | Object:

Returns the listener for chaining or assignment.

### `advance`

(

- `[time]`

)

Defined in `advance:310`

Advances the playhead. This occurs automatically each tick by default.

#### Parameters:

- `[time]` Number optional

  The amount of time in ms to advance by. Only applicable if framerate is set on the Sprite or its SpriteSheet.

### `cache`

()

Inherited from DisplayObject but overwritten in `cache:250`

Because the content of a Sprite is already in a raster format, cache is unnecessary for Sprite instances. You should not cache Sprite instances as it can degrade performance.

### `clone`

() Sprite

Inherited from DisplayObject but overwritten in `clone:347`

Returns a clone of the Sprite instance. Note that the same SpriteSheet is shared between cloned instances.

#### Returns:

Sprite:

a clone of the Sprite instance.

### `cloneProps`

(

- `o`

)
protected

Inherited from DisplayObject but overwritten in `cloneProps:462`

#### Parameters:

- `o` Sprite

### `dispatchEvent`

(

- `eventObj`
- `[target]`

)
Boolean

Inherited from EventDispatcher: `dispatchEvent:280`

Dispatches the specified event to all listeners.

#### Example

     // Use a string event
     this.dispatchEvent("complete");

     // Use an Event instance
     var event = new createjs.Event("progress");
     this.dispatchEvent(event);

#### Parameters:

- `eventObj` Object | String | Event

  An object with a "type" property, or a string type. While a generic object will work, it is recommended to use a CreateJS Event instance. If a string is used, dispatchEvent will construct an Event instance with the specified type.

- `[target]` Object optional

  The object to use as the target property of the event object. This will default to the dispatching object. This parameter is deprecated and will be removed.

#### Returns:

Boolean:

Returns the value of eventObj.defaultPrevented.

### `draw`

(

- `ctx`
- `ignoreCache`

)

Inherited from DisplayObject but overwritten in `draw:227`

Draws the display object into the specified context ignoring its visible, alpha, shadow, and transform. Returns true if the draw was handled (useful for overriding functionality). NOTE: This method is mainly for internal use, though it may be useful for advanced uses.

#### Parameters:

- `ctx` CanvasRenderingContext2D

  The canvas 2D context object to draw into.

- `ignoreCache` Boolean

  Indicates whether the draw operation should ignore any current cache. For example, used for drawing the cache (to prevent it from simply drawing an existing cache back into itself).

### `getBounds`

() Rectangle

Inherited from DisplayObject but overwritten in `getBounds:332`

Returns a Rectangle instance defining the bounds of the current frame relative to the origin. For example, a 90 x 70 frame with `regX=50` and `regY=40` would return a rectangle with [x=-50, y=-40, width=90, height=70]. This ignores transformations on the display object.

Also see the SpriteSheet getFrameBounds method.

#### Returns:

Rectangle:

A Rectangle instance. Returns null if the frame does not exist, or the image is not fully loaded.

### `getCacheDataURL`

() String

Inherited from DisplayObject: `getCacheDataURL:847`

Returns a data URL for the cache, or null if this display object is not cached. Uses cacheID to ensure a new data URL is not generated if the cache has not changed.

#### Returns:

String:

The image data url for the cache.

### `getConcatenatedMatrix`

(

- `[matrix]`

)
Matrix2D

Inherited from DisplayObject: `getConcatenatedMatrix:996`

Generates a concatenated Matrix2D object representing the combined transform of the display object and all of its parent Containers up to the highest level ancestor (usually the Stage). This can be used to transform positions between coordinate spaces, such as with localToGlobal and globalToLocal.

#### Parameters:

- `[matrix]` Matrix2D optional

  A Matrix2D object to populate with the calculated values. If null, a new Matrix2D object is returned.

#### Returns:

Matrix2D:

a concatenated Matrix2D object representing the combined transform of the display object and all of its parent Containers up to the highest level ancestor (usually the Stage).

### `getMatrix`

(

- `matrix`

)
Matrix2D

Inherited from DisplayObject: `getMatrix:984`

Returns a matrix based on this object's transform.

#### Parameters:

- `matrix` Matrix2D

  Optional. A Matrix2D object to populate with the calculated values. If null, a new Matrix object is returned.

#### Returns:

Matrix2D:

A matrix representing this display object's transform.

### `getStage`

() Stage

Inherited from DisplayObject: `getStage:859`

Returns the stage that this display object will be rendered on, or null if it has not been added to one.

#### Returns:

Stage:

The Stage instance that the display object is a descendent of. null if the DisplayObject has not been added to a Stage.

### `getTransformedBounds`

() Rectangle

Inherited from DisplayObject: `getTransformedBounds:1132`

Returns a rectangle representing this object's bounds in its parent's coordinate system (ie. with transformations applied). Objects that have been cached will return the transformed bounds of the cache.

Not all display objects can calculate their own bounds (ex. Shape). For these objects, you can use setBounds so that they are included when calculating Container bounds.

To reduce memory impact, the returned Rectangle instance may be reused internally; clone the instance or copy its values if you need to retain it.

Container instances calculate aggregate bounds for all children that return bounds via getBounds.

#### Returns:

Rectangle:

A Rectangle instance representing the bounds, or null if bounds are not available for this object.

### `globalToLocal`

(

- `x`
- `y`

)
Point

Inherited from DisplayObject: `globalToLocal:902`

Transforms the specified x and y position from the global (stage) coordinate space to the coordinate space of the display object. For example, this could be used to determine the current mouse position within the display object. Returns a Point instance with x and y properties correlating to the transformed position in the display object's coordinate space.

#### Example

     displayObject.x = 300;
     displayObject.y = 200;
     stage.addChild(displayObject);
     var point = myDisplayObject.globalToLocal(100, 100);
     // Results in x=-200, y=-100

#### Parameters:

- `x` Number

  The x position on the stage to transform.

- `y` Number

  The y position on the stage to transform.

#### Returns:

Point:

A Point instance with x and y properties correlating to the transformed position in the display object's coordinate space.

### `gotoAndPlay`

(

- `frameOrAnimation`

)

Defined in `gotoAndPlay:288`

Sets paused to false and plays the specified animation name, named frame, or frame number.

#### Parameters:

- `frameOrAnimation` String | Number

  The frame number or animation name that the playhead should move to and begin playing.

### `gotoAndStop`

(

- `frameOrAnimation`

)

Defined in `gotoAndStop:299`

Sets paused to true and seeks to the specified animation name, named frame, or frame number.

#### Parameters:

- `frameOrAnimation` String | Number

  The frame number or animation name that the playhead should move to and stop.

### `hasEventListener`

(

- `type`

)
Boolean

Inherited from EventDispatcher: `hasEventListener:329`

Indicates whether there is at least one listener for the specified event type.

#### Parameters:

- `type` String

  The string type of the event.

#### Returns:

Boolean:

Returns true if there is at least one listener for the specified event.

### `hitTest`

(

- `x`
- `y`

)
Boolean

Inherited from DisplayObject: `hitTest:1018`

Tests whether the display object intersects the specified point in local coordinates (ie. draws a pixel with alpha > 0 at the specified position). This ignores the alpha, shadow, hitArea, mask, and compositeOperation of the display object.

#### Example

     stage.addEventListener("stagemousedown", handleMouseDown);
     function handleMouseDown(event) {
         var hit = myShape.hitTest(event.stageX, event.stageY);
     }

Please note that shape-to-shape collision is not currently supported by EaselJS.

#### Parameters:

- `x` Number

  The x position to check in the display object's local coordinates.

- `y` Number

  The y position to check in the display object's local coordinates.

#### Returns:

Boolean:

A Boolean indicting whether a visible portion of the DisplayObject intersect the specified local Point.

### `initialize`

() protected

Inherited from EventDispatcher but overwritten in `initialize:197`

Initialization method.

### `isVisible`

() Boolean

Inherited from DisplayObject but overwritten in `isVisible:208`

Returns true or false indicating whether the display object would be visible if drawn to a canvas. This does not account for whether it would be visible within the boundaries of the stage. NOTE: This method is mainly for internal use, though it may be useful for advanced uses.

#### Returns:

Boolean:

Boolean indicating whether the display object would be visible if drawn to a canvas

### `localToGlobal`

(

- `x`
- `y`

)
Point

Inherited from DisplayObject: `localToGlobal:875`

Transforms the specified x and y position from the coordinate space of the display object to the global (stage) coordinate space. For example, this could be used to position an HTML label over a specific point on a nested display object. Returns a Point instance with x and y properties correlating to the transformed coordinates on the stage.

#### Example

     displayObject.x = 300;
     displayObject.y = 200;
     stage.addChild(displayObject);
     var point = myDisplayObject.localToGlobal(100, 100);
     // Results in x=400, y=300

#### Parameters:

- `x` Number

  The x position in the source display object to transform.

- `y` Number

  The y position in the source display object to transform.

#### Returns:

Point:

A Point instance with x and y properties correlating to the transformed coordinates on the stage.

### `localToLocal`

(

- `x`
- `y`
- `target`

)
Point

Inherited from DisplayObject: `localToLocal:930`

Transforms the specified x and y position from the coordinate space of this display object to the coordinate space of the target display object. Returns a Point instance with x and y properties correlating to the transformed position in the target's coordinate space. Effectively the same as using the following code with localToGlobal and globalToLocal.

     var pt = this.localToGlobal(x, y);
     pt = target.globalToLocal(pt.x, pt.y);

#### Parameters:

- `x` Number

  The x position in the source display object to transform.

- `y` Number

  The y position on the source display object to transform.

- `target` DisplayObject

  The target display object to which the coordinates will be transformed.

#### Returns:

Point:

Returns a Point instance with x and y properties correlating to the transformed position in the target's coordinate space.

### `off`

(

- `type`
- `listener`
- `[useCapture]`

)

Inherited from EventDispatcher: `off:247`

A shortcut to the removeEventListener method, with the same parameters and return value. This is a companion to the .on method.

#### Parameters:

- `type` String

  The string type of the event.

- `listener` Function | Object

  The listener function or object.

- `[useCapture]` Boolean optional

  For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase.

### `on`

(

- `type`
- `listener`
- `[scope]`
- `[once=false]`
- `[data]`
- `[useCapture=false]`

)
Function

Inherited from EventDispatcher: `on:175`

A shortcut method for using addEventListener that makes it easier to specify an execution scope, have a listener only run once, associate arbitrary data with the listener, and remove the listener.

This method works by creating an anonymous wrapper function and subscribing it with addEventListener. The created anonymous function is returned for use with .removeEventListener (or .off).

#### Example

        var listener = myBtn.on("click", handleClick, null, false, {count:3});
        function handleClick(evt, data) {
            data.count -= 1;
            console.log(this == myBtn); // true - scope defaults to the dispatcher
            if (data.count == 0) {
                alert("clicked 3 times!");
                myBtn.off("click", listener);
                // alternately: evt.remove();
            }
        }

#### Parameters:

- `type` String

  The string type of the event.

- `listener` Function | Object

  An object with a handleEvent method, or a function that will be called when the event is dispatched.

- `[scope]` Object optional

  The scope to execute the listener in. Defaults to the dispatcher/currentTarget for function listeners, and to the listener itself for object listeners (ie. using handleEvent).

- `[once=false]` Boolean optional

  If true, the listener will remove itself after the first time it is triggered.

- `[data]` optional

  Arbitrary data that will be included as the second parameter when the listener is called.

- `[useCapture=false]` Boolean optional

  For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase.

#### Returns:

Function:

Returns the anonymous function that was created and assigned as the listener. This is needed to remove the listener later using .removeEventListener.

### `play`

()

Defined in `play:268`

Play (unpause) the current animation. The Sprite will be paused if either stop or gotoAndStop is called. Single frame animations will remain unchanged.

### `removeAllEventListeners`

(

- `[type]`

)

Inherited from EventDispatcher: `removeAllEventListeners:258`

Removes all listeners for the specified type, or all listeners of all types.

#### Example

     // Remove all listeners
     displayObject.removeAllEventListeners();

     // Remove all click listeners
     displayObject.removeAllEventListeners("click");

#### Parameters:

- `[type]` String optional

  The string type of the event. If omitted, all listeners for all types will be removed.

### `removeEventListener`

(

- `type`
- `listener`
- `[useCapture]`

)

Inherited from EventDispatcher: `removeEventListener:217`

Removes the specified event listener.

Important Note: that you must pass the exact function reference used when the event was added. If a proxy function, or function closure is used as the callback, the proxy/closure reference must be used - a new proxy or closure will not work.

#### Example

     displayObject.removeEventListener("click", handleClick);

#### Parameters:

- `type` String

  The string type of the event.

- `listener` Function | Object

  The listener function or object.

- `[useCapture]` Boolean optional

  For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase.

### `set`

(

- `props`

)
DisplayObject

Inherited from DisplayObject: `set:1048`

Provides a chainable shortcut method for setting a number of properties on the instance.

#### Example

     var myGraphics = new createjs.Graphics().beginFill("#ff0000").drawCircle(0, 0, 25);
     var shape = stage.addChild(new Shape())
         .set({graphics:myGraphics, x:100, y:100, alpha:0.5});

#### Parameters:

- `props` Object

  A generic object containing properties to copy to the DisplayObject instance.

#### Returns:

DisplayObject:

Returns the instance the method is called on (useful for chaining calls.)

### `setBounds`

(

- `x`
- `y`
- `width`
- `height`

)

Inherited from DisplayObject: `setBounds:1151`

Allows you to manually specify the bounds of an object that either cannot calculate their own bounds (ex. Shape & Text) for future reference, or so the object can be included in Container bounds. Manually set bounds will always override calculated bounds.

The bounds should be specified in the object's local (untransformed) coordinates. For example, a Shape instance with a 25px radius circle centered at 0,0 would have bounds of (-25, -25, 50, 50).

#### Parameters:

- `x` Number

  The x origin of the bounds. Pass null to remove the manual bounds.

- `y` Number

  The y origin of the bounds.

- `width` Number

  The width of the bounds.

- `height` Number

  The height of the bounds.

### `setTransform`

(

- `[x=0]`
- `[y=0]`
- `[scaleX=1]`
- `[scaleY=1]`
- `[rotation=0]`
- `[skewX=0]`
- `[skewY=0]`
- `[regX=0]`
- `[regY=0]`

)
DisplayObject

Inherited from DisplayObject: `setTransform:951`

Shortcut method to quickly set the transform properties on the display object. All parameters are optional. Omitted parameters will have the default value set.

#### Example

     displayObject.setTransform(100, 100, 2, 2);

#### Parameters:

- `[x=0]` Number optional

  The horizontal translation (x position) in pixels

- `[y=0]` Number optional

  The vertical translation (y position) in pixels

- `[scaleX=1]` Number optional

  The horizontal scale, as a percentage of 1

- `[scaleY=1]` Number optional

  the vertical scale, as a percentage of 1

- `[rotation=0]` Number optional

  The rotation, in degrees

- `[skewX=0]` Number optional

  The horizontal skew factor

- `[skewY=0]` Number optional

  The vertical skew factor

- `[regX=0]` Number optional

  The horizontal registration point in pixels

- `[regY=0]` Number optional

  The vertical registration point in pixels

#### Returns:

DisplayObject:

Returns this instance. Useful for chaining commands.

### `stop`

()

Defined in `stop:278`

Stop playing a running animation. The Sprite will be playing if gotoAndPlay is called. Note that calling gotoAndPlay or play will resume playback.

### `toString`

() String

Inherited from EventDispatcher but overwritten in `toString:359`

Returns a string representation of this object.

#### Returns:

String:

a string representation of the instance.

### `uncache`

()

Inherited from DisplayObject but overwritten in `uncache:262`

Because the content of a Sprite is already in a raster format, cache is unnecessary for Sprite instances. You should not cache Sprite instances as it can degrade performance.

### `updateCache`

()

Inherited from DisplayObject but overwritten in `updateCache:256`

Because the content of a Sprite is already in a raster format, cache is unnecessary for Sprite instances. You should not cache Sprite instances as it can degrade performance.

### `updateContext`

(

- `ctx`

)

Inherited from DisplayObject: `updateContext:709`

Applies this display object's transformation, alpha, globalCompositeOperation, clipping path (mask), and shadow to the specified context. This is typically called prior to draw.

#### Parameters:

- `ctx` CanvasRenderingContext2D

  The canvas 2D to update.

### `willTrigger`

(

- `type`

)
Boolean

Inherited from EventDispatcher: `willTrigger:340`

Indicates whether there is at least one listener for the specified event type on this object or any of its ancestors (parent, parent's parent, etc). A return value of true indicates that if a bubbling event of the specified type is dispatched from this object, it will trigger at least one listener.

This is similar to hasEventListener, but it searches the entire event flow for a listener, not just this object.

#### Parameters:

- `type` String

  The string type of the event.

#### Returns:

Boolean:

Returns `true` if there is at least one listener for the specified event.

## Properties

### `_advanceCount`

Number protected

Defined in `_advanceCount:165`

Default: 0

### `_animation`

Object protected

Defined in `_animation:173`

Default: null

### `_animation`

Object protected

Defined in `_animation:181`

Default: null

### `_bounds`

Rectangle protected

Inherited from DisplayObject: `_bounds:650`

Default: null

### `_cacheDataURL`

String protected

Inherited from DisplayObject: `_cacheDataURL:626`

Default: null

### `_cacheDataURLID`

Number protected

Inherited from DisplayObject: `_cacheDataURLID:618`

Default: 0

### `_cacheOffsetX`

Number protected

Inherited from DisplayObject: `_cacheOffsetX:594`

Default: 0

### `_cacheOffsetY`

Number protected

Inherited from DisplayObject: `_cacheOffsetY:602`

Default: 0

### `_cacheScale`

Number protected

Inherited from DisplayObject: `_cacheScale:610`

Default: 1

### `_captureListeners`

Object protected

Inherited from EventDispatcher: `_captureListeners:126`

### `_dispatchAnimationEnd`

Function private

Defined in `_dispatchAnimationEnd:433`

Dispatches the "animationend" event. Returns true if a handler changed the animation (ex. calling stop, gotoAndPlay, etc.)

### `_listeners`

Object protected

Inherited from EventDispatcher: `_listeners:119`

### `_matrix`

Matrix2D protected

Inherited from DisplayObject: `_matrix:634`

Default: null

### `_rectangle`

Rectangle protected

Inherited from DisplayObject: `_rectangle:642`

Default: null

### `alpha`

Number

Inherited from DisplayObject: `alpha:307`

The alpha (transparency) for this display object. 0 is fully transparent, 1 is fully opaque.

Default: 1

### `cacheCanvas`

HTMLCanvasElement | Object

Inherited from DisplayObject: `cacheCanvas:315`

If a cache is active, this returns the canvas that holds the cached version of this display object. See Cache for more information.

Default: null

### `cacheID`

Number

Inherited from DisplayObject: `cacheID:547`

Returns an ID number that uniquely identifies the current cache for this display object. This can be used to determine if the cache has changed since a previous check.

Default: 0

### `compositeOperation`

String

Inherited from DisplayObject: `compositeOperation:472`

The composite operation indicates how the pixels of this display object will be composited with the elements behind it. If `null`, this property is inherited from the parent container. For more information, read the whatwg spec on compositing.

Default: null

### `currentAnimation`

String final

Defined in `currentAnimation:99`

Returns the name of the currently playing animation.

### `currentAnimationFrame`

Number

Defined in `currentAnimationFrame:134`

Specifies the current frame index within the currently playing animation. When playing normally, this will increase from 0 to n-1, where n is the number of frames in the current animation.

This could be a non-integer value if using time-based playback (see Sprite/framerate, or if the animation's speed is not an integer.

Default: 0

### `currentFrame`

Number

Defined in `currentFrame:89`

The frame index that will be drawn when draw is called. Note that with some SpriteSheet definitions, this will advance non-sequentially. This will always be an integer value.

Default: 0

### `cursor`

String

Inherited from DisplayObject: `cursor:582`

A CSS cursor (ex. "pointer", "help", "text", etc) that will be displayed when the user hovers over this display object. You must enable mouseover events using the enableMouseOver method to use this property. Setting a non-null cursor on a Container will override the cursor set on its descendants.

Default: null

### `DisplayObject__tick`

Function private

Defined in `DisplayObject__tick:369`

### `DisplayObject_cloneProps`

Function private

Defined in `DisplayObject_cloneProps:455`

### `DisplayObject_draw`

Function private

Defined in `DisplayObject_draw:220`

### `DisplayObject_getBounds`

Function protected

Defined in `DisplayObject_getBounds:325`

### `DisplayObject_initialize`

Function private

Defined in `DisplayObject_initialize:190`

### `filters`

Array

Inherited from DisplayObject: `filters:537`

An array of Filter objects to apply to this display object. Filters are only applied / updated when Cache or UpdateCache is called on the display object, and only apply to the area that is cached.

Default: null

### `framerate`

Number

Defined in `framerate:147`

By default Sprite instances advance one frame per tick. Specifying a framerate for the Sprite (or its related SpriteSheet) will cause it to advance based on elapsed time between ticks as appropriate to maintain the target framerate.

For example, if a Sprite with a framerate of 10 is placed on a Stage being updated at 40fps, then the Sprite will advance roughly one frame every 4 ticks. This will not be exact, because the time between each tick will vary slightly between frames.

This feature is dependent on the tick event object (or an object with an appropriate "delta" property) being passed into update.

Default: 0

### `hitArea`

DisplayObject

Inherited from DisplayObject: `hitArea:565`

A display object that will be tested when checking mouse interactions or testing getObjectsUnderPoint. The hit area will have its transformation applied relative to this display object's coordinate space (as though the hit test object were a child of this display object and relative to its regX/Y). The hitArea will be tested using only its own `alpha` value regardless of the alpha value on the target display object, or the target's ancestors (parents).

If set on a Container, children of the Container will not receive mouse events. This is similar to setting MouseChildren to false.

Note that hitArea is NOT currently used by the `hitTest()` method, nor is it supported for Stage.

Default: null

### `id`

Number

Inherited from DisplayObject: `id:325`

Unique ID for this display object. Makes display objects easier for some uses.

Default: -1

### `mask`

Shape

Inherited from DisplayObject: `mask:556`

A Shape instance that defines a vector mask (clipping path) for this display object. The shape's transformation will be applied relative to the display object's parent coordinates (as if it were a child of the parent).

Default: null

### `mouseEnabled`

Boolean

Inherited from DisplayObject: `mouseEnabled:333`

Indicates whether to include this object when running mouse interactions. Setting this to `false` for children of a Container will cause events on the Container to not fire when that child is clicked. Setting this property to `false` does not prevent the getObjectsUnderPoint method from returning the child.

Note: In EaselJS 0.7.0, the mouseEnabled property will not work properly with nested Containers. Please check out the latest NEXT version in GitHub for an updated version with this issue resolved. The fix will be provided in the next release of EaselJS.

Default: true

### `name`

String

Inherited from DisplayObject: `name:358`

An optional name for this display object. Included in toString . Useful for debugging.

Default: null

### `offset`

Number deprecated

Defined in `offset:126`

Deprecated: Not applicable to the new timing model in v0.7.0 and higher.

Default: 0

### `onAnimationEnd`

Function deprecated

Defined in `onAnimationEnd:81`

Deprecated: Use addEventListener and the "animationend" event.

REMOVED. Use addEventListener and the animationend event.

### `onClick`

Function deprecated

Inherited from DisplayObject: `onClick:501`

Deprecated: Use addEventListener and the "click" event.

REMOVED. Use addEventListener and the click event.

### `onDoubleClick`

Function deprecated

Inherited from DisplayObject: `onDoubleClick:508`

Deprecated: Use addEventListener and the "dblclick" event.

REMOVED. Use addEventListener and the dblclick event.

### `onMouseOut`

Function deprecated

Inherited from DisplayObject: `onMouseOut:522`

Deprecated: Use addEventListener and the "mouseout" event.

REMOVED. Use addEventListener and the mouseout event.

### `onMouseOver`

Function deprecated

Inherited from DisplayObject: `onMouseOver:515`

Deprecated: Use addEventListener and the "mouseover" event.

REMOVED. Use addEventListener and the mouseover event.

### `onPress`

Function deprecated

Inherited from DisplayObject: `onPress:494`

Deprecated: Use addEventListener and the "mousedown" event.

REMOVED. Use addEventListener and the mousedown event.

### `onTick`

Function deprecated

Inherited from DisplayObject: `onTick:529`

Deprecated: Use addEventListener and the "tick" event.

REMOVED. Use addEventListener and the tick event.

### `parent`

Container final

Inherited from DisplayObject: `parent:367`

A reference to the Container or Stage object that contains this display object, or null if it has not been added to one.

Default: null

### `paused`

Boolean

Defined in `paused:108`

Prevents the animation from advancing each tick automatically. For example, you could create a sprite sheet of icons, set paused to true, and display the appropriate icon by setting `currentFrame`.

Default: false

### `regX`

Number

Inherited from DisplayObject: `regX:379`

The left offset for this display object's registration point. For example, to make a 100x100px Bitmap rotate around its center, you would set regX and regY to 50.

Default: 0

### `regY`

Number

Inherited from DisplayObject: `regY:388`

The y offset for this display object's registration point. For example, to make a 100x100px Bitmap rotate around its center, you would set regX and regY to 50.

Default: 0

### `rotation`

Number

Inherited from DisplayObject: `rotation:397`

The rotation in degrees for this display object.

Default: 0

### `scaleX`

Number

Inherited from DisplayObject: `scaleX:405`

The factor to stretch this display object horizontally. For example, setting scaleX to 2 will stretch the display object to twice its nominal width. To horizontally flip an object, set the scale to a negative number.

Default: 1

### `scaleY`

Number

Inherited from DisplayObject: `scaleY:414`

The factor to stretch this display object vertically. For example, setting scaleY to 0.5 will stretch the display object to half its nominal height. To vertically flip an object, set the scale to a negative number.

Default: 1

### `shadow`

Shadow

Inherited from DisplayObject: `shadow:439`

A shadow object that defines the shadow to render on this display object. Set to `null` to remove a shadow. If null, this property is inherited from the parent container.

Default: null

### `skewX`

Number

Inherited from DisplayObject: `skewX:423`

The factor to skew this display object horizontally.

Default: 0

### `skewY`

Number

Inherited from DisplayObject: `skewY:431`

The factor to skew this display object vertically.

Default: 0

### `snapToPixel`

Boolean

Inherited from DisplayObject: `snapToPixel:483`

Indicates whether the display object should be drawn to a whole pixel when Stage/snapToPixelEnabled is true. To enable/disable snapping on whole categories of display objects, set this value on the prototype (Ex. Text.prototype.snapToPixel = true).

Default: true

### `spriteSheet`

SpriteSheet

Defined in `spriteSheet:117`

The SpriteSheet instance to play back. This includes the source image, frame dimensions, and frame data. See SpriteSheet for more information.

### `tickEnabled`

Boolean

Inherited from DisplayObject: `tickEnabled:348`

If false, the tick will not run on this display object (or its children). This can provide some performance benefits. In addition to preventing the "tick" event from being dispatched, it will also prevent tick related updates on some display objects (ex. Sprite & MovieClip frame advancing, DOMElement visibility handling).

Default: true

### `visible`

Boolean

Inherited from DisplayObject: `visible:448`

Indicates whether this display object should be rendered to the canvas and included when running the Stage Stage/getObjectsUnderPoint method.

Default: true

### `x`

Number

Inherited from DisplayObject: `x:457`

The x (horizontal) position of the display object, relative to its parent.

Default: 0

### `y`

Number

Inherited from DisplayObject: `y:465`

Default: 0

## Events

### `animationend`

Defined in `animationend:69`

Available since 0.6.0

Dispatched when an animation reaches its ends.

#### Event Payload:

- `target` Object

  The object that dispatched the event.

- `type` String

  The event type.

- `name` String

  The name of the animation that just ended.

- `next` String

  The name of the next animation that will be played, or null. This will be the same as name if the animation is looping.

### `click`

Inherited from DisplayObject: `click:206`

Available since 0.6.0

Dispatched when the user presses their left mouse button and then releases it while over the display object. See the MouseEvent class for a listing of event properties.

### `dblclick`

Inherited from DisplayObject: `dblclick:213`

Available since 0.6.0

Dispatched when the user double clicks their left mouse button over this display object. See the MouseEvent class for a listing of event properties.

### `mousedown`

Inherited from DisplayObject: `mousedown:199`

Available since 0.6.0

Dispatched when the user presses their left mouse button over the display object. See the MouseEvent class for a listing of event properties.

### `mouseout`

Inherited from DisplayObject: `mouseout:228`

Available since 0.6.0

Dispatched when the user's mouse leaves this display object. This event must be enabled using enableMouseOver. See also rollout. See the MouseEvent class for a listing of event properties.

### `mouseover`

Inherited from DisplayObject: `mouseover:220`

Available since 0.6.0

Dispatched when the user's mouse enters this display object. This event must be enabled using enableMouseOver. See also rollover. See the MouseEvent class for a listing of event properties.

### `pressmove`

Inherited from DisplayObject: `pressmove:276`

Available since 0.7.0

After a mousedown occurs on a display object, a pressmove event will be generated on that object whenever the mouse moves until the mouse press is released. This can be useful for dragging and similar operations.

### `pressup`

Inherited from DisplayObject: `pressup:284`

Available since 0.7.0

After a mousedown occurs on a display object, a pressup event will be generated on that object when that mouse press is released. This can be useful for dragging and similar operations.

### `rollout`

Inherited from DisplayObject: `rollout:256`

Available since 0.7.0

This event is similar to mouseout, with the following differences: it does not bubble, and it considers Container instances as an aggregate of their content.

For example, myContainer contains two overlapping children: shapeA and shapeB. The user moves their mouse over shapeA, then directly on to shapeB, then off both. With a listener for Mouseout:event on myContainer, two events would be received, each targeting a child element:

1. when the mouse leaves shapeA (target=shapeA)

2. when the mouse leaves shapeB (target=shapeB)

However, with a listener for "rollout" instead, only a single event is received when the mouse leaves the aggregate myContainer content (target=myContainer).

This event must be enabled using enableMouseOver. See the MouseEvent class for a listing of event properties.

### `rollover`

Inherited from DisplayObject: `rollover:236`

Available since 0.7.0

This event is similar to mouseover, with the following differences: it does not bubble, and it considers Container instances as an aggregate of their content.

For example, myContainer contains two overlapping children: shapeA and shapeB. The user moves their mouse over shapeA and then directly on to shapeB. With a listener for Mouseover:event on myContainer, two events would be received, each targeting a child element:

1. when the mouse enters shapeA (target=shapeA)

2. when the mouse enters shapeB (target=shapeB)

However, with a listener for "rollover" instead, only a single event is received when the mouse first enters the aggregate myContainer content (target=myContainer).

This event must be enabled using enableMouseOver. See the MouseEvent class for a listing of event properties.

### `tick`

Inherited from DisplayObject: `tick:292`

Available since 0.6.0

Dispatched on each display object on a stage whenever the stage updates. This occurs immediately before the rendering (draw) pass. When update is called, first all display objects on the stage dispatch the tick event, then all of the display objects are drawn to stage. Children will have their Tick:event event dispatched in order of their depth prior to the event being dispatched on their parent.

#### Event Payload:

- `target` Object

  The object that dispatched the event.

- `type` String

  The event type.

- `params` Array

  An array containing any arguments that were passed to the Stage.update() method. For example if you called stage.update("hello"), then the params would be ["hello"].