Packagecom.cyntaxic.cynmvc.view
Classpublic class CynView
InheritanceCynView Inheritance flash.display.Sprite
Implements ICynView
Subclasses CynComponent, CynComposite, CynViewProxy

CynView is the abstract base class for CynComposite and CynComponent. It should be an extended by either a CynComposite or a CynComponent class. If there is an attempt to extend CynView with any other class a CynError is thrown.



Protected Properties
 PropertyDefined By
  cynController : CynController
A reference to the CynController.
CynView
  cynModel : CynModel
A reference to the CynModel.
CynView
  describeProperties : Array
List of properties to describe on the view when using describe.
CynView
  suppressDebug : Boolean = false
Flag to set whether debugging is suppressed for this CynView.
CynView
Public Methods
 MethodDefined By
  
Creates a new instance of CynView.
CynView
  
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
  
getListeners():Array
Returns a copy of the listeners on the CynView.
CynView
  
Optionally initialize a view.
CynView
  
Removes all children of the DisplayObject from the display list.
CynView
  
Removes all the listeners added.
CynView
  
removeListener(type:String):void
Shorthand method for removeEventListener.
CynView
  
resize(vo:ResizeVO):void
Invoked when Event.RESIZE event is fired.
CynView
Protected Methods
 MethodDefined By
  
debug(message:Object):void
Traces out a debugging message.
CynView
Property Detail
cynControllerproperty
protected var cynController:CynController

A reference to the CynController.

cynModelproperty 
protected var cynModel:CynModel

A reference to the CynModel.

describePropertiesproperty 
protected var describeProperties:Array

List of properties to describe on the view when using describe.

See also

suppressDebugproperty 
protected var suppressDebug:Boolean = false

Flag to set whether debugging is suppressed for this CynView.

Constructor Detail
CynView()Constructor
public function CynView(self:CynView)

Creates a new instance of CynView.

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

Throws
CynError — If attempted to be extended without super(this) or by a class that is not CynComposite or CynComponent.
Method Detail
addListener()method
public function addListener(type:String, listener:Function, props:Object = null):void

Shorthand method for addEventListener. The first arguments are the same, but the last few are passed in with an object. Named the same as addEventListener.

Parameters

type:String — The type of the event listener.
 
listener:Function — The listener function.
 
props:Object (default = null) — An object containing any or all of the properties useCapture, priority, and useWeakReference.

addWeakListener()method 
public function addWeakListener(type:String, listener:Function):void

Shorthand method for addEventListener using weak reference. The parameters useCapture and priority are set to the default for addEventListener. To change these use addListener.

Parameters

type:String — The type of the event listener.
 
listener:Function — The listener function.

See also

debug()method 
protected function debug(message:Object):void

Traces out a debugging message.

Parameters

message:Object — The message to be traced out.

describe()method 
public function describe(compact:Boolean = true):String

Returns a valid JSON string describing some commonly used display properties. To change the properties being described add or remove from describeProperties.

Parameters

compact:Boolean (default = true) — If false the string is not compacted.

Returns
String — A valid JSON string.

See also

describeProperties
describeListeners()method 
public function describeListeners(compact:Boolean = true):String

Returns a valid JSON string describing the listeners.

Parameters

compact:Boolean (default = true) — If false the string is not compacted.

Returns
String — A valid JSON string.
getListeners()method 
public function getListeners():Array

Returns a copy of the listeners on the CynView.

Returns
Array — An array of the listeners on the CynView.
init()method 
public function init(vo:CyntaxicVO):CynView

Optionally initialize a view. This is useful when extending a graphical objects from a Flash library where the constructor is not available.

Parameters

vo:CyntaxicVO — The value object to pass parameters.

Returns
CynView — The CynView for chainability.
removeAllChildren()method 
public function removeAllChildren():Array

Removes all children of the DisplayObject from the display list. On completion an array of the objects removed is returned.

Returns
Array — An array of the objects removed.
removeAllListeners()method 
public function removeAllListeners():void

Removes all the listeners added.

removeListener()method 
public function removeListener(type:String):void

Shorthand method for removeEventListener. This function differs as the function name does not need to be passed in. It looks for the first event that matches the type and removes it. If there is more than one by the same name, it only removes the first one.

Parameters

type:String — The type of the event listener.

resize()method 
public function resize(vo:ResizeVO):void

Invoked when Event.RESIZE event is fired. A ResizeVO is passed in containing stage.stageWidth and stage.stageHeight properties.

Parameters

vo:ResizeVO — A ResizeVO containing stage.stageWidth and stage.stageHeight properties.