Packagecom.degrafa.core.collections
Classpublic class DisplayObjectCollection
InheritanceDisplayObjectCollection Inheritance DegrafaCollection Inheritance DegrafaObject

The DisplayObjectCollection stores a collection of flash.display.DisplayObject objects.



Public Properties
 PropertyDefined by
 Inheriteddocument : Object
The MXML document that created this object.
DegrafaObject
 InheritedenableEvents : Boolean
Enable events for this object.
DegrafaObject
 InheritedenableTypeChecking : Boolean
Allows internal type checking to be turned off.
DegrafaCollection
 InheritedhasEventManager : Boolean
Tests to see if a EventDispatcher instance has been created for this object.
DegrafaObject
 Inheritedid : String
The identifier used by document to refer to this object.
DegrafaObject
 Inheriteditems : Array
An array of items being stored in this collection.
DegrafaCollection
 Inheritedname : String
The name that refers to this object.
DegrafaObject
 InheritedsuppressEventProcessing : Boolean
Temporarily suppress event processing for this object.
DegrafaObject
Protected Properties
 PropertyDefined by
 InheritedeventDispatcher : EventDispatcher
EventDispatcher instance for this object.
DegrafaObject
Public Methods
 MethodDefined by
  
DisplayObjectCollection(array:Array = null, suppressEvents:Boolean = false)
Constructor.
DisplayObjectCollection
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
DegrafaObject
  
addItem(value:DisplayObject):DisplayObject
Adds a DisplayObject item to the collection.
DisplayObjectCollection
  
addItemAt(value:DisplayObject, index:Number):DisplayObject
Adds a DisplayObject item to this collection at the specified index.
DisplayObjectCollection
  
Adds a series of DisplayObject objects to this collection.
DisplayObjectCollection
 Inherited
addListener(value:*):void
Addes a property change event listener to the passed object.
DegrafaCollection
 Inherited
addListeners():void
Addes a property change event listener to each item in the collection.
DegrafaCollection
 Inherited
concat(... args):Array
Concatenates the elements specified in the parameters with the elements in an array and creates a new array.
DegrafaCollection
 Inherited
dispatchEvent(evt:Event):Boolean
Dispatches an event into the event flow.
DegrafaObject
 Inherited
dispatchPropertyChange(bubbles:Boolean = false, property:Object = null, oldValue:Object = null, newValue:Object = null, source:Object = null):Boolean
Dispatches an property change event into the event flow.
DegrafaObject
 Inherited
every(callback:Function, thisObject:* = null):Boolean
Executes a test function on each item in the array until an item is reached that returns false for the specified function.
DegrafaCollection
 Inherited
filter(callback:Function, thisObject:* = null):Array
Executes a test function on each item in the array and constructs a new array for all items that return true for the specified function.
DegrafaCollection
 Inherited
forEach(callback:Function, thisObject:* = null):void
Executes a function on each item in the array.
DegrafaCollection
  
getItemAt(index:Number):DisplayObject
Retrieve a DisplayObject item from the collection based on the index value requested.
DisplayObjectCollection
  
getItemIndex(value:DisplayObject):int
Retrieve a DisplayObject item from the collection based on the object value.
DisplayObjectCollection
 Inherited
hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
DegrafaObject
 Inherited
indexOf(searchElement:*, fromIndex:int = 0):int
Searches for an item in an array by using strict equality (===) and returns the index position of the item.
DegrafaCollection
 Inherited
initChange(property:String, oldValue:Object, newValue:Object, source:Object):void
Helper function for dispatching property changes
DegrafaObject
 Inherited
initialized(document:Object, id:String):void
Called after the implementing object has been created and all component properties specified on the MXML tag have been initialized.
DegrafaObject
 Inherited
join(sep:*):String
Converts the elements in an array to strings, inserts the specified separator between the elements, concatenates them, and returns the resulting string.
DegrafaCollection
 Inherited
lastIndexOf(searchElement:*, fromIndex:int = 0x7fffffff):int
Searches for an item in an array, working backward from the last item, and returns the index position of the matching item using strict equality (===).
DegrafaCollection
 Inherited
map(callback:Function, thisObject:* = null):Array
Executes a function on each item in an array, and constructs a new array of items corresponding to the results of the function on each item in the original array.
DegrafaCollection
 Inherited
pop():*
Removes the last element from an array and returns the value of that element.
DegrafaCollection
 Inherited
propertyChangeHandler(event:PropertyChangeEvent):void
Property change event handler for this collection.
DegrafaCollection
 Inherited
push(... args):uint
Adds one or more elements to the end of an array and returns the new length of the array.
DegrafaCollection
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
DegrafaObject
  
removeItem(value:DisplayObject):DisplayObject
Removes an DisplayObject item from the collection.
DisplayObjectCollection
  
removeItemAt(index:Number):DisplayObject
Removes a DisplayObject object from this collection at the specified index.
DisplayObjectCollection
 Inherited
removeListener(value:*):void
Removes the property change event listener from the passed object.
DegrafaCollection
 Inherited
Removes the property change event listener from each item in the collection.
DegrafaCollection
 Inherited
reverse():Array
Reverses the array in place.
DegrafaCollection
  
setItemIndex(value:DisplayObject, newIndex:Number):Boolean
Change the index of the DisplayObject object within this collection.
DisplayObjectCollection
 Inherited
shift():*
Removes the first element from an array and returns that element.
DegrafaCollection
 Inherited
slice(startIndex:int = 0, endIndex:int = 16777215):Array
Returns a new array that consists of a range of elements from the original array, without modifying the original array.
DegrafaCollection
 Inherited
some(callback:Function, thisObject:* = null):Boolean
Executes a test function on each item in the array until an item is reached that returns true.
DegrafaCollection
 Inherited
sort(... args):Array
Sorts the elements in an array.
DegrafaCollection
 Inherited
sortOn(fieldName:Object, options:Object = null):Array
Sorts the elements in an array according to one or more fields in the array.
DegrafaCollection
 Inherited
splice(startIndex:int, deleteCount:uint, ... values):Array
Adds elements to and removes elements from an array.
DegrafaCollection
 Inherited
unshift(... args):uint
Adds one or more elements to the beginning of an array and returns the new length of the array.
DegrafaCollection
 Inherited
willTrigger(type:String):Boolean
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
DegrafaObject
Protected Methods
 MethodDefined by
 Inherited
_addItem(value:*):*
Adds a new item to the collection.
DegrafaCollection
 Inherited
_addItemAt(value:*, index:Number):*
Add a item at the given index.
DegrafaCollection
 Inherited
_getItemAt(index:Number):*
Return a item at the given index.
DegrafaCollection
 Inherited
_getItemIndex(value:*):int
Return the index for the item in the collection.
DegrafaCollection
 Inherited
_removeItem(value:*):*
Removes a item from the collection.
DegrafaCollection
 Inherited
_removeItemAt(index:Number):*
Removes a item from the collection.
DegrafaCollection
 Inherited
_setItemIndex(value:*, newIndex:Number):Boolean
Change the position of an item in the collection
DegrafaCollection
Events
 EventSummaryDefined by
 Inherited  DegrafaObject
 Inherited  DegrafaObject
Constructor detail
DisplayObjectCollection()constructor
public function DisplayObjectCollection(array:Array = null, suppressEvents:Boolean = false)

Constructor.

The display object collection constructor accepts 2 optional arguments that specify the display objects to be added and a event operation flag.

Parameters
array:Array (default = null) — An array of DisplayObject objects.
 
suppressEvents:Boolean (default = false) — A boolean value indicating if events should not be dispatched for this collection.
Method detail
addItem()method
public function addItem(value:DisplayObject):DisplayObject

Adds a DisplayObject item to the collection.

Parameters
value:DisplayObject — The DisplayObject object to be added.

Returns
DisplayObject — The DisplayObject object that was added.
addItemAt()method 
public function addItemAt(value:DisplayObject, index:Number):DisplayObject

Adds a DisplayObject item to this collection at the specified index.

Parameters
value:DisplayObject — The DisplayObject object that is to be added.
 
index:Number — The position in the collection at which to add the DisplayObject object.

Returns
DisplayObject — The DisplayObject object that was added.
addItems()method 
public function addItems(value:DisplayObjectCollection):DisplayObjectCollection

Adds a series of DisplayObject objects to this collection.

Parameters
value:DisplayObjectCollection — The collection to be added to this DisplayObject collection.

Returns
DisplayObjectCollection — The resulting DisplayObjectCollection after the objects are added.
getItemAt()method 
public function getItemAt(index:Number):DisplayObject

Retrieve a DisplayObject item from the collection based on the index value requested.

Parameters
index:Number — The collection index of the DisplayObject object to retrieve.

Returns
DisplayObject — The DisplayObject object that was requested if it exists.
getItemIndex()method 
public function getItemIndex(value:DisplayObject):int

Retrieve a DisplayObject item from the collection based on the object value.

Parameters
value:DisplayObject — The DisplayObject object for which the index is to be retrieved.

Returns
int — The DisplayObject index value that was requested if it exists.
removeItem()method 
public function removeItem(value:DisplayObject):DisplayObject

Removes an DisplayObject item from the collection.

Parameters
value:DisplayObject — The DisplayObject object to be removed.

Returns
DisplayObject — The DisplayObject object that was removed.
removeItemAt()method 
public function removeItemAt(index:Number):DisplayObject

Removes a DisplayObject object from this collection at the specified index.

Parameters
index:Number — The index of the DisplayObject object to remove.

Returns
DisplayObject — The DisplayObject object that was removed.
setItemIndex()method 
public function setItemIndex(value:DisplayObject, newIndex:Number):Boolean

Change the index of the DisplayObject object within this collection.

Parameters
value:DisplayObject — The DisplayObject object that is to be repositioned.
 
newIndex:Number — The position at which to place the DisplayObject object within the collection.

Returns
Boolean — True if the operation is successful False if unsuccessful.