Packagecom.soundstep.ui.layouts
Classpublic class TileUI
InheritanceTileUI Inheritance CanvasUI Inheritance flash.display.MovieClip

Author: Romuald Quantin - www.soundstep.com
Class version: 3.0.1
Actionscript version: 3.0
Copyright: Mozilla Public License 1.1 (MPL 1.1)
http://www.opensource.org/licenses/mozilla1.1.php
You can use BaseUI in any flash site, except to include/distribute it in another framework, application, template, component or structure that is meant to build, scaffold or generate source files.

Date: 08-2008
Usage:
TileUI is a subclass of CanvasUI that lays out its children in a grid of equal-sized cells.
You can set additional properties like horizontalGap, verticalGap, direction and padding.


Example
  var tile:TileUI = new TileUI();
  addChildUI(tile);
  tile.direction = TileUI.DIRECTION_HORIZONTAL;
  tile.padding = new Padding(10, 10, 10, 10);
  tile.name = "tile";
  tile.reference = this;
  tile.percentWidth = "50%";
  tile.height = 200;
  tile.right = 20;
  tile.bottom = 20;
  tile.canvasAlpha = .4;
  



Public Properties
 PropertyDefined by
 InheritedalignX : String
horizontal alignment when the property ratio is set to ElementUI.RATIO_IN or ElementUI.RATIO_OUT
can accept ElementUI.ALIGN_LEFT, ElementUI.ALIGN_RIGHT, ElementUI.ALIGN_CENTER
CanvasUI
 InheritedalignY : String
vertical alignment when the property ratio is set to ElementUI.RATIO_IN or ElementUI.RATIO_OUT
can accept ElementUI.ALIGN_CENTER, ElementUI.ALIGN_TOP, ElementUI.ALIGN_BOTTOM
CanvasUI
 InheritedbaseUI : BaseUI
get the instance of the BaseUI class, used for the children added with addChild or addChildUI
CanvasUI
 Inheritedbottom : Number
bottom value (from the reference), Number or String
CanvasUI
 InheritedbuttonMode : Boolean
Specifies the button mode of this sprite
CanvasUI
 InheritedbypassSize : Boolean
whether or not the DisplayObject will be resized (not working with ratio set to RATIO_IN or RATIO_OUT)
CanvasUI
 InheritedcanvasAlpha : Number
background alpha of the canvas
CanvasUI
 InheritedcanvasColor : uint
background color of the canvas
CanvasUI
 Inheritedcontainer : Sprite
get the instance of the container, it contains the children added with addChild and addChildUI
CanvasUI
  direction : String
direction of the children added in the tile, can be TileUI.DIRECTION_HORIZONTAL or TileUI.DIRECTION_VERTICAL
TileUI
 InheritedforceReferenceHeight : Number
force the height of the reference
CanvasUI
 InheritedforceReferenceWidth : Number
force the width of the reference
CanvasUI
 Inheritedheight : Number
height of the canvas
CanvasUI
 InheritedhorizontalCenter : Number
horizontal center value (from the reference), Number or String
CanvasUI
  horizontalGap : Number
horizontal space between each children
TileUI
 InheritedinitialWidth : Number
width of the DisplayObject when added to the BaseUI instance
CanvasUI
 InheritedkeepOnScreen : Boolean
keep a DisplayObject in the screen
CanvasUI
 InheritedlayoutMask : Mask
get the instance of the mask
CanvasUI
 Inheritedleft : Number
left value (from the reference), Number or String
CanvasUI
 InheritedmouseChildren : Boolean
Determines whether or not the children of the object are mouse enabled
CanvasUI
 InheritednumChildren : int
Returns the number of children of the CanvasUI container
CanvasUI
 InheritedonStage : Boolean
set the stage as a reference to calculate position ans sizes, if false the parent will be the reference
CanvasUI
  padding : Padding
space around the children
TileUI
 InheritedpercentHeight : *
set the height percentage (will accept Number or String, with or without the percentage character
CanvasUI
 InheritedpercentWidth : *
set the width percentage (will accept Number or String, with or without the percentage character
CanvasUI
 Inheritedproperties : Object
Object to get or set the CanvasUI properties, for example:
element.properties = {top:0, bottom:"20", onStage:false, width:"50%"};
CanvasUI
 Inheritedratio : String
type of ratio of the CanvasUI, can be ElementUI.RATIO_IN or ElementUI.RATIO_OUT
any other String will set the ratio to none
the following properties cannot be set or are not used a ratio has been specified:
x, y, width, height, horizontalCenter and verticalCenter
CanvasUI
 Inheritedreference : DisplayObjectContainer
specify a DisplayObjectContainer reference on which the size and position of the ElementUI will refer to
if not set, the onStage property value is the reference (onStage true = stage, onStage false = parent)
CanvasUI
 Inheritedright : Number
right value (from the reference), Number or String
CanvasUI
 InheritedscrollPane : *
get the instance of the scrollpane used for the scrollbars
you must cast the return: Scrollpane(canvas.scrollpane), the wild card has been used not to import the SCrollpane classes if not used
CanvasUI
 Inheritedtop : Number
top value (from the reference), Number or String
CanvasUI
 Inheritedui : ElementUI
get a the wrapper ElementUI instance
CanvasUI
 InheriteduseInitialSize : Boolean
use the size that has been recorded when the DisplayObject has been added to the BaseUI instance
useful when a mask or other DisplayObject can disturb the real size of the DisplayObject
CanvasUI
 InheritedverticalCenter : Number
vertical center value (from the reference), Number or String
CanvasUI
  verticalGap : Number
vertical space between each children
TileUI
 Inheritedwidth : Number
width of the canvas
CanvasUI
 Inheritedwrapper : Wrapper
get the instance of the wrapper
CanvasUI
 Inheritedx : Number
x position of the canvas, Number or String
CanvasUI
 Inheritedy : Number
y position of the canvas
CanvasUI
Public Methods
 MethodDefined by
  
TileUI(widthLayout:Number = 100, heightLayout:Number = 100, layoutScrollbar:Boolean = true, layoutMask:Boolean = true)
Constructor Create an instance of the TileUI class
TileUI
  
addChild(child:DisplayObject):DisplayObject
Adds a child DisplayObject instance to this Tile container
TileUI
 Inherited
addChildAt(child:DisplayObject, index:int):DisplayObject
Adds a child DisplayObject instance to the CanvasUI container
CanvasUI
  
addChildUI(child:DisplayObject):ElementUI
create an ElementUI instance and add the child to the display list
TileUI
 Inherited
contains(child:DisplayObject):Boolean
Determines whether or not the specified display object is a child of the CanvasUI container or the instance itself
CanvasUI
 Inherited
forceSizeContainer(width:Number, height:Number):void
function to force the size of the container (will update the scrollbars if used)
CanvasUI
 Inherited
getChildAt(index:int):DisplayObject
Returns the child display object instance that exists at the specified index
CanvasUI
 Inherited
getChildByName(name:String):DisplayObject
Returns the child display object that exists with the specified name
CanvasUI
 Inherited
getChildIndex(child:DisplayObject):int
Returns the index position of a child DisplayObject instance
CanvasUI
 Inherited
getChildUI(child:DisplayObject):ElementUI
get a child ElementUI instance
CanvasUI
 Inherited
get a child ElementUI instance using the name
CanvasUI
  
refresh(e:BaseEventUI = null):void
refresh the tile elements and its children position
TileUI
 Inherited
removeChild(child:DisplayObject):DisplayObject
Removes the specified child DisplayObject instance from the child list of the CanvasUI container
CanvasUI
 Inherited
removeChildAt(index:int):DisplayObject
Removes a child DisplayObject from the specified index position in the child list of the DisplayObjectContainer
CanvasUI
 Inherited
removeChildUI(child:DisplayObject):void
remove a child from the BaseUI instance
CanvasUI
 Inherited
setChildIndex(child:DisplayObject, index:int):void
Changes the position of an existing child in the CanvasUI container
CanvasUI
 Inherited
swapChildren(child1:DisplayObject, child2:DisplayObject):void
Swaps the z-order (front-to-back order) of the two specified child objects
CanvasUI
 Inherited
swapChildrenAt(index1:int, index2:int):void
Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the child list.
CanvasUI
Public Constants
 ConstantDefined by
  DIRECTION_HORIZONTAL : String = "horizontal"
[static] static constant for the direction (property direction), the children are added horizontally
TileUI
  DIRECTION_VERTICAL : String = "vertical"
[static] static constant for the direction (property direction), the children are added vertically
TileUI
Property detail
directionproperty
direction:String  [read-write]

direction of the children added in the tile, can be TileUI.DIRECTION_HORIZONTAL or TileUI.DIRECTION_VERTICAL

Implementation
    public function get direction():String
    public function set direction(value:String):void
horizontalGapproperty 
horizontalGap:Number  [read-write]

horizontal space between each children

Implementation
    public function get horizontalGap():Number
    public function set horizontalGap(value:Number):void
paddingproperty 
padding:Padding  [read-write]

space around the children

Implementation
    public function get padding():Padding
    public function set padding(value:Padding):void
verticalGapproperty 
verticalGap:Number  [read-write]

vertical space between each children

Implementation
    public function get verticalGap():Number
    public function set verticalGap(value:Number):void
Constructor detail
TileUI()constructor
public function TileUI(widthLayout:Number = 100, heightLayout:Number = 100, layoutScrollbar:Boolean = true, layoutMask:Boolean = true)

Constructor Create an instance of the TileUI class

Parameters
widthLayout:Number (default = 100) — width of the tile
 
heightLayout:Number (default = 100) — height of the tile
 
layoutScrollbar:Boolean (default = true) — whether or not the canvas creates and uses a mask to show only the content within the box
 
layoutMask:Boolean (default = true) — whether or not the canvas creates and uses scrollbars if the content is bigger than the tile (scrollpane instance)
Method detail
addChild()method
public override function addChild(child:DisplayObject):DisplayObject

Adds a child DisplayObject instance to this Tile container

Parameters
child:DisplayObject — DisplayObject

Returns
DisplayObject — DisplayObject
addChildUI()method 
public override function addChildUI(child:DisplayObject):ElementUI

create an ElementUI instance and add the child to the display list

Parameters
child:DisplayObject — DisplayObject

Returns
ElementUI — ElementUI
refresh()method 
public override function refresh(e:BaseEventUI = null):void

refresh the tile elements and its children position

Parameters
e:BaseEventUI (default = null)
Constant detail
DIRECTION_HORIZONTALconstant
public static const DIRECTION_HORIZONTAL:String = "horizontal"

static constant for the direction (property direction), the children are added horizontally

DIRECTION_VERTICALconstant 
public static const DIRECTION_VERTICAL:String = "vertical"

static constant for the direction (property direction), the children are added vertically