Package | com.cyntaxic.cynmvc.view |
Class | public class CynComposite |
Inheritance | CynComposite CynView 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.
Method | Defined By | ||
---|---|---|---|
CynComposite(self:CynComposite)
Creates a new instance of CynComposite. | CynComposite | ||
Adds a child CynView to the display list. | CynComposite | ||
Adds a child CynView to the display list at the specified index. | CynComposite | ||
addListener(type:String, listener:Function, props:Object = null):void
Shorthand method for addEventListener. | CynView | ||
addWeakListener(type:String, listener:Function):void
Shorthand method for addEventListener using weak reference. | CynView | ||
describe(compact:Boolean = true):String
Returns a valid JSON string describing some commonly used display properties. | CynView | ||
describeListeners(compact:Boolean = true):String
Returns a valid JSON string describing the listeners. | CynView | ||
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 | ||
getListeners():Array
Returns a copy of the listeners on the CynView. | CynView | ||
Optionally initialize a view. | CynView | ||
Removes a child of the CynView from the display list. | CynComposite | ||
removeAllChildren():Array
Removes all children of the DisplayObject from the display list. | CynView | ||
removeAllListeners():void
Removes all the listeners added. | CynView | ||
Removes a child of the CynView from the display list at the specified index. | CynComposite | ||
removeListener(type:String):void
Shorthand method for removeEventListener. | CynView | ||
removeSelf(event:Event = null):CynView
Removes itself using the remove method. | CynComposite | ||
Invoked when Event.RESIZE event is fired. | CynView |
CynComposite | () | Constructor |
public function CynComposite(self:CynComposite)
Creates a new instance of CynComposite
.
self:CynComposite — Reference to itself to enforce it as an abstract class.
|
CynError — If attempted to be extended without super(this) .
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
CynView — The view that has been removed.
|
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.
|
CynView — The removed view.
|