ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
org.osmf.layout 

LayoutMetadata  - AS3 OSMF

Packageorg.osmf.layout
Classpublic class LayoutMetadata
InheritanceLayoutMetadata Inheritance Metadata Inheritance EventDispatcher Inheritance Object

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines a metadata object that contains the properties upon which a layout renderer will base its layout.

View the examples



Public Properties
 PropertyDefined By
  bottom : Number
Defines how many pixels should be present between the bottom side of the target's bounding box, and the bottom side of its container.
LayoutMetadata
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  height : Number
Defines the desired vertical offset of a target expressed in pixels.
LayoutMetadata
  horizontalAlign : String
Defines the desired horizontal alignment to be applied to the target when layout of the target leaves surplus horizontal blank space.
LayoutMetadata
  includeInLayout : Boolean
When set to true (default), the target will participate in the layout process.
LayoutMetadata
  index : Number
Defines the desired position of the target in the display list of its context.
LayoutMetadata
 Inheritedkeys : Vector.<String>
[read-only] The keys stored in this Metadata object.
Metadata
  layoutMode : String
When set to LayoutMode.HORIZONTAL or LayoutMode.VERTICAL, then the renderer will ignore its target's positioning settings (either influencing X or Y, depending on the layoutMode chosen), laying out its elements adjacent in the index specified by the 'index' property.
LayoutMetadata
  left : Number
Defines the desired horizontal offset of the target in pixels.
LayoutMetadata
  paddingBottom : Number
Defines the thickness of the blank space that is to be placed at the target's bottom side.
LayoutMetadata
  paddingLeft : Number
Defines the thickness of the blank space that is to be placed at the target's left-hand side.
LayoutMetadata
  paddingRight : Number
Defines the thickness of the blank space that is to be placed at the target's right-hand side.
LayoutMetadata
  paddingTop : Number
Defines the thickness of the blank space that is to be placed at the target's top side.
LayoutMetadata
  percentHeight : Number
Defines the desired height of a target expressed as a percentage of its container's height.
LayoutMetadata
  percentWidth : Number
Defines the desired width of a target expressed as a percentage of its container's width.
LayoutMetadata
  percentX : Number
Defines the desired horizontal offset of a target expressed as a percentage of its container's width.
LayoutMetadata
  percentY : Number
Defines the desired vertical offset of a target expressed as a percentage of its container's height.
LayoutMetadata
  right : Number
Defines how many pixels should be present between the right-hand side of the target's bounding box, and the right-hand side of its container.
LayoutMetadata
  scaleMode : String
Defines the desired scaleMode to be applied to the target.
LayoutMetadata
  snapToPixel : Boolean
When set to true, the target's calculated position and size will be rounded.
LayoutMetadata
  top : Number
Defines the desired vertical offset of the target in pixels.
LayoutMetadata
  verticalAlign : String
Defines the desired vertical alignment to be applied to the target when layout of the target leaves surplus vertical blank space.
LayoutMetadata
  width : Number
Defines the desired horizontal size of a target expressed in pixels.
LayoutMetadata
  x : Number
Defines the desired horizontal offset of a target expressed in pixels.
LayoutMetadata
  y : Number
Defines the desired vertical offset of a target expressed in pixels.
LayoutMetadata
Public Methods
 MethodDefined By
  
Constructor.
LayoutMetadata
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
EventDispatcher
 Inherited
Stores the specified value in this Metadata object, using the specified key.
Metadata
 Inherited
Dispatches an event into the event flow.
EventDispatcher
 Inherited
Returns the value associate with the specified key.
Metadata
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
Removes the value associated with the specified key from this Metadata object.
Metadata
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
 InheritedDispatched when a new value is added to the Metadata object.Metadata
 InheritedDispatched when a value within the Metadata object changes.Metadata
 InheritedDispatched when a value is removed from the Metadata object.Metadata
Public Constants
 ConstantDefined By
  LAYOUT_NAMESPACE : String = "http://www.osmf.org/layout/1.0"
[static] Namespace URL for LayoutMetadata objects when added to a MediaElement or MediaContainer.
LayoutMetadata
Property Detail

bottom

property
bottom:Number

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines how many pixels should be present between the bottom side of the target's bounding box, and the bottom side of its container.



Implementation
    public function get bottom():Number
    public function set bottom(value:Number):void

height

property 
height:Number

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines the desired vertical offset of a target expressed in pixels.



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

horizontalAlign

property 
horizontalAlign:String

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines the desired horizontal alignment to be applied to the target when layout of the target leaves surplus horizontal blank space.



Implementation
    public function get horizontalAlign():String
    public function set horizontalAlign(value:String):void

includeInLayout

property 
includeInLayout:Boolean

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

When set to true (default), the target will participate in the layout process. When set to false, it will be ignored.



Implementation
    public function get includeInLayout():Boolean
    public function set includeInLayout(value:Boolean):void

index

property 
index:Number

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines the desired position of the target in the display list of its context.



Implementation
    public function get index():Number
    public function set index(value:Number):void

layoutMode

property 
layoutMode:String

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

When set to LayoutMode.HORIZONTAL or LayoutMode.VERTICAL, then the renderer will ignore its target's positioning settings (either influencing X or Y, depending on the layoutMode chosen), laying out its elements adjacent in the index specified by the 'index' property.



Implementation
    public function get layoutMode():String
    public function set layoutMode(value:String):void

left

property 
left:Number

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines the desired horizontal offset of the target in pixels.



Implementation
    public function get left():Number
    public function set left(value:Number):void

paddingBottom

property 
paddingBottom:Number

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines the thickness of the blank space that is to be placed at the target's bottom side.



Implementation
    public function get paddingBottom():Number
    public function set paddingBottom(value:Number):void

paddingLeft

property 
paddingLeft:Number

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines the thickness of the blank space that is to be placed at the target's left-hand side.



Implementation
    public function get paddingLeft():Number
    public function set paddingLeft(value:Number):void

paddingRight

property 
paddingRight:Number

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines the thickness of the blank space that is to be placed at the target's right-hand side.



Implementation
    public function get paddingRight():Number
    public function set paddingRight(value:Number):void

paddingTop

property 
paddingTop:Number

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines the thickness of the blank space that is to be placed at the target's top side.



Implementation
    public function get paddingTop():Number
    public function set paddingTop(value:Number):void

percentHeight

property 
percentHeight:Number

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines the desired height of a target expressed as a percentage of its container's height.



Implementation
    public function get percentHeight():Number
    public function set percentHeight(value:Number):void

percentWidth

property 
percentWidth:Number

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines the desired width of a target expressed as a percentage of its container's width.



Implementation
    public function get percentWidth():Number
    public function set percentWidth(value:Number):void

percentX

property 
percentX:Number

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines the desired horizontal offset of a target expressed as a percentage of its container's width.



Implementation
    public function get percentX():Number
    public function set percentX(value:Number):void

percentY

property 
percentY:Number

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines the desired vertical offset of a target expressed as a percentage of its container's height.



Implementation
    public function get percentY():Number
    public function set percentY(value:Number):void

right

property 
right:Number

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines how many pixels should be present between the right-hand side of the target's bounding box, and the right-hand side of its container.



Implementation
    public function get right():Number
    public function set right(value:Number):void

scaleMode

property 
scaleMode:String

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines the desired scaleMode to be applied to the target. Possible values are on org.osmf.layout.ScaleMode.



Implementation
    public function get scaleMode():String
    public function set scaleMode(value:String):void

snapToPixel

property 
snapToPixel:Boolean

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

When set to true, the target's calculated position and size will be rounded.



Implementation
    public function get snapToPixel():Boolean
    public function set snapToPixel(value:Boolean):void

top

property 
top:Number

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines the desired vertical offset of the target in pixels.



Implementation
    public function get top():Number
    public function set top(value:Number):void

verticalAlign

property 
verticalAlign:String

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines the desired vertical alignment to be applied to the target when layout of the target leaves surplus vertical blank space.



Implementation
    public function get verticalAlign():String
    public function set verticalAlign(value:String):void

width

property 
width:Number

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines the desired horizontal size of a target expressed in pixels.



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

x

property 
x:Number

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines the desired horizontal offset of a target expressed in pixels.



Implementation
    public function get x():Number
    public function set x(value:Number):void

y

property 
y:Number

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Defines the desired vertical offset of a target expressed in pixels.



Implementation
    public function get y():Number
    public function set y(value:Number):void
Constructor Detail

LayoutMetadata

()Constructor
public function LayoutMetadata()

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Constructor.

Constant Detail

LAYOUT_NAMESPACE

Constant
public static const LAYOUT_NAMESPACE:String = "http://www.osmf.org/layout/1.0"

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Namespace URL for LayoutMetadata objects when added to a MediaElement or MediaContainer.

LayoutMetadataExample.as

package org.osmf.layout
{
    import flash.display.Sprite;
    
    import org.osmf.media.MediaPlayerSprite;
    import org.osmf.media.URLResource;

    public class LayoutMetadataExample extends Sprite
    {
        public function LayoutMetadataExample()
        {
            var sprite:MediaPlayerSprite = new MediaPlayerSprite();
            addChild(sprite);
            
            sprite.resource = new URLResource("http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApostol_640_500_short.flv");
            
            // Construct a metadata instance, and set an absolute width and height of 
            // 100 pixels:
            var layoutMetadata:LayoutMetadata = new LayoutMetadata();
            layoutMetadata.width = 100;
            layoutMetadata.height = 100;
            
            // Apply the layout metadata to the media element at hand, resulting
            // in the video to be shown at 100x100 pixels:
            sprite.media.addMetadata(LayoutMetadata.LAYOUT_NAMESPACE, layoutMetadata);
        }
        
    }
}