Class List

Class DisplayObject

Extends EventDispatcher.
The DisplayObject class is the base class for all objects that can be placed on the canvas.
DisplayObject is an abstract base class, therefore, you cannot call DisplayObject directly.
All display objects should inherit from the DisplayObject class, and implement the render() method.

Class Summary
Constructor Attributes Constructor Name and Description
 
Constructor.
Field Summary
Field Attributes Field Name and Description
 
Indicates the alpha transparency value of the object specified.
 
Indicates the height of the display object, in pixels.
 
id
Indicates the instance id of the DisplayObject.
 
Specifies whether this object receives mouse messages.
 
Indicates the instance name of the DisplayObject.
 
The reference of the DisplayObjectContainer object that contains this display object.
 
Indicates the x coordinate of registration point of the display object.
 
Indicates the x coordinate of registration point of the display object.
 
Indicates the rotation of the DisplayObject instance, in degrees, from its original orientation.
 
Indicates the horizontal scale (percentage) of the object as applied from the registration point.
 
Indicates the vertical scale (percentage) of an object as applied from the registration point of the object.
 
The reference of the Stage of the display object.
 
A Boolean value that indicates whether the pointing hand (hand cursor) appears when the mouse rolls over the display object.
 
Whether or not the display object is visible.
 
Indicates the width of the display object, in pixels.
 
x
Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.
 
y
Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.
Method Summary
Method Attributes Method Name and Description
 
Gets the scaled height of the display object currently, in pixels.
 
Gets the scaled width of the display object currently, in pixels.
 
getRect(target)
Gets rectangle of this display object within specific target coordinate space.
 
Gets the stage reference, rather than using DisplayObject.stage, you'd better use DisplayObject.getStage().
 
Converts the (x, y) point from the Stage (global) coordinates to the display object's (local) coordinates.
 
hitTestObject(object, usePixelCollision, tolerance)
Evaluates the display object to see if it overlaps or intersects with the object parameter.
 
hitTestPoint(x, y, usePixelCollision, tolerance)
Evaluates the display object to see if it overlaps or intersects with the point specified by the x and y parameters.
 
Converts the (x, y) point from the display object's (local) coordinates to the Stage (global) coordinates.
 
localToTarget(x, y, target)
Converts the (x, y) point from the display object's (local) coordinates to the target object's coordinates.
 
onMouseEvent(event)
A handler for mouse events.
 
render(context)
The real rendering workhorse, it should be overridden by subclasses.
 
Returns the string representation of the specified DisplayObject.
Methods borrowed from class EventDispatcher:
addEventListener, dispatchEvent, hasEventListener, removeAllEventListeners, removeEventListener, removeEventListenerByType
Class Detail
DisplayObject()
Constructor.
Field Detail
alpha
Indicates the alpha transparency value of the object specified.

height
Indicates the height of the display object, in pixels.

id
Indicates the instance id of the DisplayObject.

mouseEnabled
Specifies whether this object receives mouse messages.

name
Indicates the instance name of the DisplayObject.

parent
The reference of the DisplayObjectContainer object that contains this display object.

regX
Indicates the x coordinate of registration point of the display object.

regY
Indicates the x coordinate of registration point of the display object.

rotation
Indicates the rotation of the DisplayObject instance, in degrees, from its original orientation.

scaleX
Indicates the horizontal scale (percentage) of the object as applied from the registration point.

scaleY
Indicates the vertical scale (percentage) of an object as applied from the registration point of the object.

stage
The reference of the Stage of the display object.

useHandCursor
A Boolean value that indicates whether the pointing hand (hand cursor) appears when the mouse rolls over the display object.

visible
Whether or not the display object is visible.

width
Indicates the width of the display object, in pixels.

x
Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.

y
Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.
Method Detail
getCurrentHeight()
Gets the scaled height of the display object currently, in pixels.

getCurrentWidth()
Gets the scaled width of the display object currently, in pixels.

getRect(target)
Gets rectangle of this display object within specific target coordinate space.
Parameters:
target

getStage()
Gets the stage reference, rather than using DisplayObject.stage, you'd better use DisplayObject.getStage().

globalToLocal(x, y)
Converts the (x, y) point from the Stage (global) coordinates to the display object's (local) coordinates.
Parameters:
x
y

hitTestObject(object, usePixelCollision, tolerance)
Evaluates the display object to see if it overlaps or intersects with the object parameter.
Parameters:
object
usePixelCollision
tolerance

hitTestPoint(x, y, usePixelCollision, tolerance)
Evaluates the display object to see if it overlaps or intersects with the point specified by the x and y parameters.
Parameters:
x
y
usePixelCollision
tolerance

localToGlobal(x, y)
Converts the (x, y) point from the display object's (local) coordinates to the Stage (global) coordinates.
Parameters:
x
y

localToTarget(x, y, target)
Converts the (x, y) point from the display object's (local) coordinates to the target object's coordinates.
Parameters:
x
y
target

onMouseEvent(event)
A handler for mouse events. It only works when Stage.traceMouseTarget=true. Default is null.
Parameters:
event

render(context)
The real rendering workhorse, it should be overridden by subclasses.
Parameters:
context

toString()
Returns the string representation of the specified DisplayObject.

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 25 2011 15:02:39 GMT+0800 (CST)