API Documentation | All Packages | All Classes | Index | Frames No Frames |
Class SVGRoot

Package | com.zavoo.svg.nodes
Class | public class SVGRoot
Inheritance | SVGRoot SVGNode flash.display.Sprite

Root container of the SVG

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined by
--- | --- | ---
|  | currentNode : SVGNode | SVGRoot
|  | _elementById : Object Object to hold node id registration | SVGRoot
|  | height : Number return height of SVG | SVGRoot
|  | invalidNodeCount : int | SVGRoot
|  | loadTime : int [read-only] Used to synchronize tweens | SVGRoot
|  | scale : Number Set scaleX and scaleY at the same time | SVGRoot
|  | svgRoot : SVGRoot Recursively searches for the root node | SVGNode
|  | title : String | SVGRoot
|  | width : Number return width of SVG | SVGRoot
|  | xml : XML [write-only] Set super._xml Create new _elementById object | SVGRoot

Protected Properties
Hide Inherited Protected Properties
Show Inherited Protected Properties

| Property | Defined by
--- | --- | ---
|  | _firstRendering : Boolean = true | SVGNode
|  | _graphicsCommands : Array List of graphics commands to draw node. | SVGNode
|  | _invalidDisplay : Boolean = false If true, redraw sprite graphics Set to true on any change to xml | SVGNode
|  | _style : Object Used for caching node attribute style values. | SVGNode
|  | _xml : XML SVG XML for this node | SVGNode

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined by
--- | --- | ---
|  | SVGRoot(xml:XML = null) | SVGRoot
|  | addChild(child:DisplayObject):DisplayObject Track nodes as they are added so we know when to send the RENDER_DONE event | SVGNode
|  | getAttribute(attribute:*, defaultValue:* = null):* | SVGNode
|  | getElement(id:String):* Retrieve registered node by name | SVGRoot
|  | getHeight():Number Get height calculated from _minY and _maxY | SVGNode
|  | getStyle(name:String):String Support default SVG style values | SVGRoot
|  | getWidth():Number Get width calculated from _minX and _maxX | SVGNode
|  | invalidateDisplay():void Force a redraw of a node and its children | SVGNode
|  | registerElement(id:String, node:*):void Register a node | SVGRoot
|  | setStyle(name:String, value:String):void Set node style to new value Updates SVG XML and then calls refreshGraphis() | SVGNode

Protected Methods
Hide Inherited Protected Methods
Show Inherited Protected Methods

| Method | Defined by
--- | --- | ---
|  | addRootMask(xVal:Number, yVal:Number, widthVal:Number, heightVal:Number):void Draw rectangluar mask | SVGRoot
|  | checkX(value:Number):void Check value of x against _minX and _maxX, Update values when appropriate | SVGNode
|  | checkY(value:Number):void Check value of y against _minY and _maxY, Update values when appropriate | SVGNode
|  | clearChildren():void Remove all child nodes | SVGNode
|  | draw():void Clear current graphics and call runGraphicsCommands to render SVG element | SVGNode
|  | generateGraphicsCommands():void Called to generate AS3 graphics commands from the SVG instructions | SVGNode
|  | loadAttribute(name:String, field:String = null):void Load an XML attribute into the current node | SVGNode
|  | loadStyle(name:String, field:String = null):void Load an SVG style into the current node | SVGNode
|  | nodeBeginFill():void Called at the start of drawing an SVG element. | SVGNode
|  | nodeEndFill():void Called at the end of drawing an SVG element | SVGNode
|  | onMouseClick(event:MouseEvent):void | SVGNode
|  | onMouseDown(event:MouseEvent):void | SVGNode
|  | onMouseMove(event:MouseEvent):void | SVGNode
|  | onMouseOut(event:MouseEvent):void | SVGNode
|  | onMouseOver(event:MouseEvent):void | SVGNode
|  | onMouseUp(event:MouseEvent):void | SVGNode
|  | onNodeAdded(event:Event):void If node has an "id" attribute, register it with the root node | SVGNode
|  | onNodeRemoved(event:Event):void | SVGNode
|  | parse():void Parse the SVG XML. | SVGNode
|  | redrawNode(event:Event):void Triggers on ENTER_FRAME event Redraws node graphics if _invalidDisplay == true | SVGNode
|  | runGraphicsCommands():void Execute graphics commands contained in var _graphicsCommands | SVGNode
|  | setAttributes():void Add support for viewBox elements | SVGRoot
|  | setupEvents():void | SVGRoot
|  | setupFilters():void Add any assigned filters to node | SVGNode
|  | transformNode():void Perform transformations defined by the transform attribute | SVGNode

Public Constants
Hide Inherited Public Constants
Show Inherited Public Constants

| Constant | Defined by
--- | --- | ---
|  | attributeList : Array [static] | SVGNode

Property detail

currentNode | property

`currentNode:SVGNode` [read-write]Implementation
`public function get currentNode():SVGNode`
`public function set currentNode(value:SVGNode):void`

_elementById | property |

`public var _elementById:Object`

Object to hold node id registration

height | property |

`height:Number` [read-write]

return height of SVG

Implementation
`public function get height():Number`
`public function set height(value:Number):void`

invalidNodeCount | property |

`invalidNodeCount:int` [read-write]Implementation
`public function get invalidNodeCount():int`
`public function set invalidNodeCount(value:int):void`

loadTime | property |

`loadTime:int` [read-only]

Used to synchronize tweens

Implementation
`public function get loadTime():int`

scale | property |

`scale:Number` [read-write]

Set scaleX and scaleY at the same time

Implementation
`public function get scale():Number`
`public function set scale(value:Number):void`

title | property |

`title:String` [read-write]Implementation
`public function get title():String`
`public function set title(value:String):void`

width | property |

`width:Number` [read-write]

return width of SVG

Implementation
`public function get width():Number`
`public function set width(value:Number):void`

xml | property |

`xml:XML` [write-only]

Set super._xml Create new _elementById object

Implementation
`public function set xml(value:XML):void`
Constructor detail

SVGRoot | () | constructor

`public function SVGRoot(xml:XML = null)`Parameters

| `xml:XML` (default = `null`)``

Method detail

addRootMask | () | method

`protected function addRootMask(xVal:Number, yVal:Number, widthVal:Number, heightVal:Number):void`

Draw rectangluar mask

Parameters

| `xVal:Number`
| `yVal:Number`
| `widthVal:Number`
| `heightVal:Number`

getElement | () | method |

`public function getElement(id:String):*`

Retrieve registered node by name

Parameters

| `id:String` — id of node to be retrieved

Returns

| `*` — node registered with id

getStyle | () | method |

`public override function getStyle(name:String):String`

Support default SVG style values

Parameters

| `name:String`

Returns

| `String`

registerElement | () | method |

`public function registerElement(id:String, node:*):void`

Register a node

Parameters

| `id:String` — id to register node under
| `node:*` — node to be registered

setAttributes | () | method |

`protected override function setAttributes():void`

Add support for viewBox elements

setupEvents | () | method |

`protected override function setupEvents():void`