AbstractAsulObject

Base class for all ASUL elements.

An ASUL element is one that can be completely described via some xml data, and offers a constructor that takes such XML data, constructing itself based on that data.

Children will be notified when the size of their parent changes, which allows them to perform layouting or other actions. This only works if an asul object is a direct child of the resizing object. Any normal display objects will break the chain.

= Attributes =

{{Attribute This attribute can be used for layouting elements. This attribute takes a list of four comma separated expressions, which can be either floating point numbers in a range of [0, 1], or mathematical terms, which will be evaluated whenever the parent's size changes. For those terms there are two variables available:, the parent's width, and  , the parent's height. So, the basic format is, where the different values may either be 0-1 or a term. Examples:
 * h= ==
 * name = anchors
 * type = String
 * default =
 * info =
 * will make the element always fill the top half of it's parent.
 * together with the x and y attribute set to 10 will make the element have a 10 pixel margin to its parent.

Furthermore, for the x and y coordinates, there are two additional parameters available:  and , the object's width and height, respectively, before the size change handling. This means they are primarily useful when the width / height are of a fixed value. In such cases something like this is possible:, which puts the object in the lower right corner of the parent.

Example
}}

Example
{{Attribute Can be used to tile the background of an object that uses an image (and only those using an image background) to tile the image.
 * h= ==
 * name = backgroundrepeat
 * type = Boolean
 * default = false
 * info =

Example
}}

{{Attribute Can be used to define the blend mode of an object. The modes are as defined in the BlendMode class. Use the constant values here, e.g.  or.
 * h= ==
 * name = blendmode
 * type = String
 * default = normal
 * info =

Example
}}

{{Attribute A comma separated list of up to four numbers, which represent the left, top, right and bottom padding of this element, respectively. The displayed width and height remains the same, regardless of the set padding, but the available space for child elements will change, accordingly.
 * h= ==
 * name = padding
 * type = Number
 * info =

Example
}}

{{Attribute Whether this object should adjust its size to match its childrens' overall bounds. This can be useful for container objects.
 * h= ==
 * name = resize
 * type = Boolean
 * info =

Example
}}

{{Attribute The rotation of this object. Note that unlike normal Flash display objects, the object is not rotated around its top left corner (or anchor, if set in the IDE), but around its center, and kept aligned to its x and y position (i.e. x and y attributes stay the same when rotation changes, whereas width and height do not).
 * h= ==
 * name = rotation
 * type = Number
 * info =

The rotation is given in degrees (not radians).

Example
}}

{{Attribute Allows defining a scale9grid for the loaded background image. This makes it a lot easier to create backgrounds with custom borders.
 * h= ==
 * name = scale9grid
 * type = String
 * info =

The given value must be a comma separated list of four numeric values. The values must be in the range of [0, backgroundImageWidth] for the first and third number, and [0, backgroundImageHeight] for the second and fourth number. The numbers represent:
 * first: the left vertical scaling grid line.
 * second: the top horizontal scaling grid line.
 * third: the right vertical scaling grid line.
 * fourth: the bottom horizontal scaling grid line.

For more information on scale9grid, see Adobe's documentation. Note that unlike the original scale9grid of flash, this one also works on bitmap data (JPGs, PNGs, etc), thanks to the ScaleBitmap class from.

Example
The above one is without using a scale grid, the lower one is using a scale grid.

}}

{{Attribute Allows linking ASUL components. This uses Flash's navigateToURL function.
 * h= ==
 * name = url
 * type = String
 * info =

Example
}}

{{Attribute The initial horizontal position of this element, relative to it's parent.
 * h= ==
 * name = x
 * type = Number
 * default = 0
 * info =

Example
}}

{{Attribute The initial vertical position of this element, relative to it's parent.
 * h= ==
 * name = y
 * type = Number
 * default = 0
 * info =

Example
}}