Packagecom.rubenswieringa.book
Classpublic class PageManager
InheritancePageManager Inheritance mx.containers.Canvas
SubclassesBook

PageManager provides the core functionality for the Book class.

See also

Book
Page


Public Properties
 PropertyDefined by
  currentPage : int
[write-only] Index of the current left-hand page (-1 if the Book is unopened).
PageManager
  openAt : int
Index of the Page at which the Book is opened at startup, can only be set once, and only at startup.
PageManager
  pages : ArrayCollection
[write-only] Array of all respective Pages in this Book instance.
PageManager
Public Methods
 MethodDefined by
  
Constructor.
PageManager
  
addChild(child:DisplayObject):DisplayObject
Adds a child Page instance to this PageManager instance.
PageManager
  
addChildAt(child:DisplayObject, index:int):DisplayObject
Adds a child Page instance to this PageManager instance at the index position specified.
PageManager
  
contains(child:DisplayObject):Boolean
Determines whether the specified display object is a child of the PageManager instance or the instance itself.
PageManager
  
getChildByName(name:String):DisplayObject
Returns the child display object that exists with the specified name.
PageManager
  
getChildIndex(child:DisplayObject):int
Returns the index position of a child Page instance.
PageManager
  
getChildren():Array
Returns an Array of Page objects consisting of the content children of the container.
PageManager
  
getObjectsUnderPoint(point:Point):Array
Returns an array of objects that lie under the specified point and are children (or grandchildren, and so on) of this PageManager instance.
PageManager
  
owns(child:DisplayObject):Boolean
Returns true if the chain of owner properties points from child to this PageManager.
PageManager
  
Removes all children (Page instances) from the child list of this container.
PageManager
  
removeChild(child:DisplayObject):DisplayObject
Removes a child Page from the child list of this Container.
PageManager
  
removeChildAt(index:int):DisplayObject
Removes a child Page from the child list of this Container at the specified index.
PageManager
  
setChildIndex(child:DisplayObject, newIndex:int):void
Changes the position of an existing child in the PageManager container.
PageManager
  
swapChildren(child1:DisplayObject, child2:DisplayObject):void
Swaps the position of two Page instances in the PageManager.
PageManager
  
swapChildrenAt(index1:int, index2:int):void
Swaps the position of two Page instances in the PageManager at the specified indexes.
PageManager
Events
 EventSummaryDefined by
   Dispatched when a page is added to or removed from the PageManager.PageManager
Property detail
currentPageproperty
currentPage:int  [write-only]

Index of the current left-hand page (-1 if the Book is unopened).

This property can be used as the source for data binding.

Implementation
    public function set currentPage(value:int):void
openAtproperty 
openAt:int  [read-write]

Index of the Page at which the Book is opened at startup, can only be set once, and only at startup.

The default value is -1.

Implementation
    public function get openAt():int
    public function set openAt(value:int):void
pagesproperty 
pages:ArrayCollection  [write-only]

Array of all respective Pages in this Book instance.

This property can be used as the source for data binding.

Implementation
    public function set pages(value:ArrayCollection):void
Constructor detail
PageManager()constructor
public function PageManager()

Constructor.

Method detail
addChild()method
public override function addChild(child:DisplayObject):DisplayObject

Adds a child Page instance to this PageManager instance. Regardless of this method's signiature, the child parameter must always be an instance of the Page class.

Parameters
child:DisplayObject — The Page instance to add as a child of this PageManager instance.

Returns
DisplayObject — The Page instance that you pass in the child parameter.

Throws
— Gets thrown when the child parameter is not an instance of the Page class.

See also

addChildAt()method 
public override function addChildAt(child:DisplayObject, index:int):DisplayObject

Adds a child Page instance to this PageManager instance at the index position specified.

Parameters
child:DisplayObject — The Page instance to add as a child of this PageManager instance.
 
index:int — The index position to which the child is added.

Returns
DisplayObject — The Page instance that you pass in the child parameter.

Throws
— Gets thrown when the child parameter is not an instance of the Page class.

See also

contains()method 
public override function contains(child:DisplayObject):Boolean

Determines whether the specified display object is a child of the PageManager instance or the instance itself.

Parameters
child:DisplayObject — The child object to test.

Returns
Boolean — true if the child object is a child of the PageManager or the container itself; otherwise false.
getChildByName()method 
public override function getChildByName(name:String):DisplayObject

Returns the child display object that exists with the specified name.

Parameters
name:String — The name of the child to return.

Returns
DisplayObject — The child Page with the specified name as a DisplayObject. You may want to cast the return value of this method back to a Page.
getChildIndex()method 
public override function getChildIndex(child:DisplayObject):int

Returns the index position of a child Page instance.

Parameters
child:DisplayObject — The Page instance to identify.

Returns
int — The index position of the child Page to identify.
getChildren()method 
public override function getChildren():Array

Returns an Array of Page objects consisting of the content children of the container. Note that this method returns the source property of the pages property.

Returns
Array — Array of Page objects consisting of the content children of the container.

See also

getObjectsUnderPoint()method 
public override function getObjectsUnderPoint(point:Point):Array

Returns an array of objects that lie under the specified point and are children (or grandchildren, and so on) of this PageManager instance.

Parameters
point:Point — The point under which to look.

Returns
Array — An array of objects that lie under the specified point and are children (or grandchildren, and so on) of this PageManager instance.
owns()method 
public override function owns(child:DisplayObject):Boolean

Returns true if the chain of owner properties points from child to this PageManager.

Parameters
child:DisplayObject — A UIComponent.

Returns
Boolean — true if the child is parented or owned by this PageManager.
removeAllChildren()method 
public override function removeAllChildren():void

Removes all children (Page instances) from the child list of this container.

removeChild()method 
public override function removeChild(child:DisplayObject):DisplayObject

Removes a child Page from the child list of this Container.

Parameters
child:DisplayObject — The Page instance to remove.

Returns
DisplayObject — The removed child.

Throws
— Gets thrown when the child parameter is not an instance of the Page class.
 
— Gets thrown when the child parameter is not a child of this PageManager.

See also

removeChildAt()method 
public override function removeChildAt(index:int):DisplayObject

Removes a child Page from the child list of this Container at the specified index.

Parameters
index:int — The child index of the Page to remove.

Returns
DisplayObject — The removed child.

Throws
— Gets thrown when the supplied index is out of bounds.

See also

setChildIndex()method 
public override function setChildIndex(child:DisplayObject, newIndex:int):void

Changes the position of an existing child in the PageManager container.

Parameters
child:DisplayObject — The child Page instance for which you want to change the index number.
 
newIndex:int — The resulting index number for the child display object.

Throws
— Gets thrown when the child parameter is not an instance of the Page class.
 
— Gets thrown when the child parameter is not a child of this PageManager.

See also

swapChildren()method 
public override function swapChildren(child1:DisplayObject, child2:DisplayObject):void

Swaps the position of two Page instances in the PageManager.

Parameters
child1:DisplayObject — The first child object.
 
child2:DisplayObject — The second child object.

Throws
— Gets thrown when the child parameter is not an instance of the Page class.
 
— Gets thrown when the child parameter is not a child of this PageManager.

See also

swapChildrenAt()method 
public override function swapChildrenAt(index1:int, index2:int):void

Swaps the position of two Page instances in the PageManager at the specified indexes.

Parameters
index1:int — The index position of the first child object.
 
index2:int — The index position of the second child object.
Event detail
contentChangedevent 
Event object type: com.rubenswieringa.book.BookEvent

Dispatched when a page is added to or removed from the PageManager.

See also