Document

From Frontal Wiki

Jump to: navigation, search

The document tag is not created by the user in a Frontal definition but is instead automatically added to every new Frontal document. The document tag is accessible by all of its children tags via the property "document."

While the document tag is not explicit in the Frontal definition, it is available for applying styles and provides certain special methods. Here is an example of how the document element may be used in a style sheet to apply a "base-url" style to all elements in the definition:

<style><![CDATA[
    document
        {
            base-url: http://frontalcode.com/;
        }
]]></style>

Implementation

It is implemented by the Document class which extends the Container class which is to say it extends the "div" tag.

Properties

The Document class adds these properties to the Container class:

  • externalAssetManager: To Do.
  • stylesManager: To Do.
  • fontManager: To Do.
  • title: To Do.
  • movieParent: To Do.

Methods

The Document class adds these methods to the Container class:

  • getNodeElement: This method returns a DocumentElement object from an XML node in the docuemnt's definition. It takes the following parameter:
    • node: The XML element for which to find a DocumentElement object.
  • write: This method appends a valid XML snippet to the current definition.
    • xmlString: A string description of a valid XML snippet (meaning it has one parent element and all tags are properly closed).
    • parent: The DocumentElement object in which to append the XML. By default this is the document object.
    • insertPoint: An XML node to control the insertion point of the XML. By default this is null and the content will be appended to the end of the parent's children nodes.
    • insertAfter: If insertPoint is not null and this is true then the XML will be inserted just after the insert point. If it is false then it will be inserted just before the insert point.
This page is incomplete
Personal tools
Get Adobe Flash player