Packagecom.cyntaxic.cynmvc.view
Classpublic class CynComposite
InheritanceCynComposite Inheritance CynView Inheritance flash.display.Sprite
Implements ICynView

CynComposite is used for views that have other views inside of it. CynComposite has functions like add, addAt, remove and removeAt which work just like addChild and removeChild except for some added functionality for the framework.



Protected Properties
 PropertyDefined By
 InheritedcynController : CynController
A reference to the CynController.
CynView
 InheritedcynModel : CynModel
A reference to the CynModel.
CynView
 InheriteddescribeProperties : Array
List of properties to describe on the view when using describe.
CynView
 InheritedsuppressDebug : Boolean = false
Flag to set whether debugging is suppressed for this CynView.
CynView
Public Methods
 MethodDefined By
  
Creates a new instance of CynComposite.
CynComposite
  
add(view:CynView, props:Object = null):CynView
Adds a child CynView to the display list.
CynComposite
  
addAt(view:CynView, index:int, props:Object = null):CynView
Adds a child CynView to the display list at the specified index.
CynComposite
 Inherited
addListener(type:String, listener:Function, props:Object = null):void
Shorthand method for addEventListener.
CynView
 Inherited
addWeakListener(type:String, listener:Function):void
Shorthand method for addEventListener using weak reference.
CynView
 Inherited
describe(compact:Boolean = true):String
Returns a valid JSON string describing some commonly used display properties.
CynView
 Inherited
describeListeners(compact:Boolean = true):String
Returns a valid JSON string describing the listeners.
CynView
  
destroy(view:CynView):void
Destroys a child of the CynView from the display list.
CynComposite
  
destroyAt(index:int):void
Destroys a child of the CynView from the display list at the specified index.
CynComposite
  
destroySelf(event:Event = null):CynView
Destroys itself using the destroy method.
CynComposite
 Inherited
getListeners():Array
Returns a copy of the listeners on the CynView.
CynView
 Inherited
Optionally initialize a view.
CynView
  
remove(view:CynView, completely:Boolean = false):CynView
Removes a child of the CynView from the display list.
CynComposite
 Inherited
Removes all children of the DisplayObject from the display list.
CynView
 Inherited
Removes all the listeners added.
CynView
  
removeAt(index:int, completely:Boolean = false):CynView
Removes a child of the CynView from the display list at the specified index.
CynComposite
 Inherited
removeListener(type:String):void
Shorthand method for removeEventListener.
CynView
  
removeSelf(event:Event = null):CynView
Removes itself using the remove method.
CynComposite
 Inherited
resize(vo:ResizeVO):void
Invoked when Event.RESIZE event is fired.
CynView
Protected Methods
 MethodDefined By
 Inherited
debug(message:Object):void
Traces out a debugging message.
CynView
Constructor Detail
CynComposite()Constructor
public function CynComposite(self:CynComposite)

Creates a new instance of CynComposite.

Parameters
self:CynComposite — Reference to itself to enforce it as an abstract class.

Throws
CynError — If attempted to be extended without super(this).
Method Detail
add()method
public function add(view:CynView, props:Object = null):CynView

Adds a child CynView to the display list. An optional set of properties can be sent to the object at time of addition. These property names match the properties of other display objects.

Parameters

view:CynView — The view to be added to the display list.
 
props:Object (default = null) — An object with display object properties.

Returns
CynView — The view that was added.
addAt()method 
public function addAt(view:CynView, index:int, props:Object = null):CynView

Adds a child CynView to the display list at the specified index. An optional set of properties can be sent to the object at time of addition. These property names match the properties of other display objects.

Parameters

view:CynView — The view to be added to the display list.
 
index:int — The index to add the object at.
 
props:Object (default = null) — An object with display object properties.

Returns
CynView — The view that was added.
destroy()method 
public function destroy(view:CynView):void

Destroys a child of the CynView from the display list. All reference is destroyed and the object is nulled out the object as well as its children.

Parameters

view:CynView — The view to be destroyed.

destroyAt()method 
public function destroyAt(index:int):void

Destroys a child of the CynView from the display list at the specified index. All reference is destroyed and the object is nulled out the object as well as its children.

Parameters

index:int — The index at which to destroy the view.


Throws
CynError — If object at index is not a CynView.
destroySelf()method 
public function destroySelf(event:Event = null):CynView

Destroys itself using the destroy method. If the parent isn't a CynComposite, the view is just removed with removeChild. If the parent doesn't have either function, the function fails silently.

Parameters

event:Event (default = null) — An optional parameter to invoke on an event.

Returns
CynView — The deleted view.
remove()method 
public function remove(view:CynView, completely:Boolean = false):CynView

Removes a child of the CynView from the display list. When the completely flag is set the function completely destroys all reference and nulls out the object as well as its children.

Parameters

view:CynView — The view to be removed from the display list.
 
completely:Boolean (default = false) — Flag set to determine if it is removed or destroyed completely.

Returns
CynView — The view that has been removed.

See also

removeAt()method 
public function removeAt(index:int, completely:Boolean = false):CynView

Removes a child of the CynView from the display list at the specified index. When the completely flag is set the function completely destroys all reference and nulls out the object as well as its children.

Parameters

index:int — The index at which to remove the view.
 
completely:Boolean (default = false) — Flag set to determine if it is removed or destroyed completely.

Returns
CynView — The view that has been removed.

Throws
CynError — If object at index is not a CynView.
removeSelf()method 
public function removeSelf(event:Event = null):CynView

Removes itself using the remove method. If the parent isn't a CynComposite, the view is just removed with removeChild. If the parent doesn't have either function, the function fails silently.

Parameters

event:Event (default = null) — An optional parameter to invoke on an event.

Returns
CynView — The removed view.