Packagespark.layouts
Classpublic class CarouselLayout
InheritanceCarouselLayout Inheritance PerspectiveAnimationNavigatorLayoutBase Inheritance AnimationNavigatorLayoutBase Inheritance NavigatorLayoutBase Inheritance LayoutBase Inheritance OnDemandEventDispatcher Inheritance Object

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

This class is experimental, which means it has not been tested or documented as thoroughly as other core Apache Flex classes.

A CarouselLayout class arranges the layout elements in a sequence along an arc, with one of them at a time selected.

The position of the elements is determined by the radii radiusX, radiusY and radiusZ. These can be properties can be set the negative values to produce a ring of elements surrounding the view point.

The rotation of the elements is determined by the rotationX and rotationY properties.

MXML SyntaxexpandedHide MXML Syntax

The <st:CarouselLayout> tag inherits all of the tag attributes of its superclass, and adds the following tag attributes:

	  <st:AccordionLayout
	    Properties
	    angle="360"
	    depthColor="-1"
	    depthColorAlpha="1"
	    horizontalAlign="center|left|right"
	    horizontalAlignOffset="0"
	    horizontalAlignOffsetPercent="0"
	    numUnselectedElements="-1"
	    radiusX="100"
	    radiusY="0"
	    radiusZ="NaN"
	    rotateX="none|reversed|standard"
	    rotateY="none|reversed|standard"
	    verticalAlign="bottom|middle|top"
	    verticalAlignOffset="0"
	    verticalAlignOffsetPercent="0"
	  />
	  


Public Properties
 PropertyDefined By
  angle : Number
The segment of a circle to rotate the elements around.
CarouselLayout
 InheritedanimationValue : Number
[read-only]  If the animationType is "direct" the animationValue will ease from 1 to 0.
AnimationNavigatorLayoutBase
 InheritedclipAndEnableScrolling : Boolean
If true, specifies to clip the children to the boundaries of the viewport.
LayoutBase
  depthColor : int
The color tint to apply to elements as their are moved back on the z axis.
CarouselLayout
  depthColorAlpha : Number
The alpha to be used for the color tint that is applied to elements as their are moved back on the z axis.
CarouselLayout
 InheriteddropIndicator : DisplayObject
The DisplayObject that this layout uses for the drop indicator during a drag-and-drop operation.
LayoutBase
 Inheritedduration : Number
The duration of the animation in milliseconds.
AnimationNavigatorLayoutBase
 Inheritedeaser : IEaser
The easing behavior for this effect.
AnimationNavigatorLayoutBase
  elementHorizontalAlign : String
The horizontal transform point of elements.
CarouselLayout
 Inheritedelements : Vector.<IVisualElement>
[read-only]
NavigatorLayoutBase
  elementVerticalAlign : String
The vertical transform point of elements.
CarouselLayout
 InheritedfieldOfView : Number
 fieldOfView  
PerspectiveAnimationNavigatorLayoutBase
 InheritedfirstIndexInView : int
[read-only] firstIndexInView
NavigatorLayoutBase
 InheritedfocalLength : Number
 focalLength  
PerspectiveAnimationNavigatorLayoutBase
  horizontalAlign : String
The horizontal position of the selected element in the viewport.
CarouselLayout
  horizontalAlignOffset : Number
The offset in pixels to be used in conjunction with horizontalAlign to set the horizontal position of the selected element in the viewport.
CarouselLayout
  horizontalAlignOffsetPercent : Number
The offset as a percentage of the unscaled width of the viewport to be used in conjunction with horizontalAlign to set the horizontal position of the selected element in the viewport.
CarouselLayout
 InheritedhorizontalScrollPosition : Number
The x coordinate of the origin of the viewport in the component's coordinate system, where the default value is (0,0) corresponding to the upper-left corner of the component.
LayoutBase
 InheritedindicesInLayout : Vector.<int>
[read-only] A convenience method for determining the elements included in the layout.
NavigatorLayoutBase
 InheritedindicesNotInLayout : Vector.<int>
[read-only] A convenience method for determining the elements excluded from the layout.
NavigatorLayoutBase
 InheritedlastIndexInView : int
[read-only] lastIndexInView
NavigatorLayoutBase
 InheritednumElementsInLayout : int
[read-only] Returns an int specifying number of elements included in the layout.
NavigatorLayoutBase
 InheritednumElementsNotInLayout : int
[read-only] Returns an int specifying number of elements not included in the layout.
NavigatorLayoutBase
 InheritednumIndicesInView : int
[read-only] inheritDoc
NavigatorLayoutBase
  numUnselectedElements : int
The number of items to show either side of the selected item are positioned around this element.
CarouselLayout
 InheritedprojectionCenterX : Number
 projectionCenterX
PerspectiveAnimationNavigatorLayoutBase
 InheritedprojectionCenterY : Number
 projectionCenterY
PerspectiveAnimationNavigatorLayoutBase
  radiusX : Number
The radius to be used on the x axis for the SemiCarouselLayout.
CarouselLayout
  radiusY : Number
The radius to be used on the y axis for the SemiCarouselLayout.
CarouselLayout
  radiusZ : Number
The radius to be used on the z axis for the SemiCarouselLayout.
CarouselLayout
 InheritedrenderingData : Boolean
[read-only] inheritDoc
NavigatorLayoutBase
  rotateX : String
Whether rotation should be applied to the x axis of elements.
CarouselLayout
  rotateY : String
Whether rotation should be applied to the y axis of elements.
CarouselLayout
 InheritedscrollBarDirection : String
The direction of the ScrollBar to use for navigation.
NavigatorLayoutBase
 InheritedselectedElement : IVisualElement
[read-only]
NavigatorLayoutBase
 InheritedselectedIndex : int
The index of the selected INavigatorLayout item.
NavigatorLayoutBase
 InheritedsizeChangedInLayoutPass : Boolean
[read-only]
NavigatorLayoutBase
 Inheritedtarget : GroupBase
[override] The GroupBase container whose elements are measured, sized and positioned by this layout.
PerspectiveAnimationNavigatorLayoutBase
 InheritedtypicalLayoutElement : ILayoutElement
Used by layouts when fixed row/column sizes are requested but a specific size isn't specified.
LayoutBase
 InheritedunscaledHeight : Number
[read-only] A convenience method for determining the unscaled height of the viewport.
NavigatorLayoutBase
 InheritedunscaledWidth : Number
[read-only] A convenience method for determining the unscaled width of the viewport.
NavigatorLayoutBase
 InheriteduseScrollBarForNavigation : Boolean
useScrollBarForNavigation
NavigatorLayoutBase
 InheriteduseVirtualLayout : Boolean
A container can hold any number of children.
LayoutBase
  verticalAlign : String
The vertical position of the selected element in the viewport.
CarouselLayout
  verticalAlignOffset : Number
The offset in pixels to be used in conjunction with verticalAlign to set the vertical position of the selected element in the viewport.
CarouselLayout
  verticalAlignOffsetPercent : Number
The offset as a percentage of the unscaled height of the viewport to be used in conjunction with verticalAlign to set the vertical position of the selected element in the viewport.
CarouselLayout
 InheritedverticalScrollPosition : Number
The y coordinate of the origin of the viewport in the component's coordinate system, where the default value is (0,0) corresponding to the upper-left corner of the component.
LayoutBase
Protected Properties
 PropertyDefined By
 Inherited_elements : Vector.<IVisualElement>
NavigatorLayoutBase
Public Methods
 MethodDefined By
  
Constructor.
CarouselLayout
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
OnDemandEventDispatcher
 Inherited
Calculates the drop location in the data provider of the drop target for the specified dragEvent.
LayoutBase
 Inherited
When useVirtualLayout is true, this method can be used by the layout target to clear cached layout information when the target changes.
LayoutBase
 Inherited
dispatchEvent(event:Event):Boolean
OnDemandEventDispatcher
 Inherited
elementAdded(index:int):void
Called by the target after a layout element has been added and before the target's size and display list are validated.
LayoutBase
 Inherited
elementRemoved(index:int):void
This method must is called by the target after a layout element has been removed and before the target's size and display list are validated.
LayoutBase
 Inherited
getElementBounds(index:int):Rectangle
Returns the specified element's layout bounds as a Rectangle or null if the index is invalid, the corresponding element is null, includeInLayout=false, or if this layout's target property is null.
LayoutBase
 Inherited
getHorizontalScrollPositionDelta(navigationUnit:uint):Number
[override]
NavigatorLayoutBase
 Inherited
getNavigationDestinationIndex(currentIndex:int, navigationUnit:uint, arrowKeysWrapFocus:Boolean):int
Delegation method that determines which item to navigate to based on the current item in focus and user input in terms of NavigationUnit.
LayoutBase
 Inherited
getProjectionRectAtZ(z:Number):Rectangle
Returns the visible projection plane at a specific depth.
PerspectiveAnimationNavigatorLayoutBase
 Inherited
Computes the verticalScrollPosition and horizontalScrollPosition deltas needed to scroll the element at the specified index into view.
LayoutBase
 Inherited
getVerticalScrollPositionDelta(navigationUnit:uint):Number
[override]
NavigatorLayoutBase
 Inherited
hasEventListener(type:String):Boolean
OnDemandEventDispatcher
 Inherited
Hides the previously shown drop indicator, created by the showDropIndicator() method, removes it from the display list and also stops the drag scrolling.
LayoutBase
 Inherited
NavigatorLayoutBase
 Inherited
isAnimating():Boolean
 Returns whether the layout is currently animating.
AnimationNavigatorLayoutBase
 Inherited
measure():void
[override]
NavigatorLayoutBase
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
OnDemandEventDispatcher
 Inherited
showDropIndicator(dropLocation:DropLocation):void
Sizes, positions and parents the drop indicator based on the specified drop location.
LayoutBase
  
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
[override] Sizes and positions the target's elements.
CarouselLayout
 Inherited
updateScrollRect(w:Number, h:Number):void
[override]
NavigatorLayoutBase
 Inherited
willTrigger(type:String):Boolean
OnDemandEventDispatcher
Protected Methods
 MethodDefined By
 Inherited
applyColorTransformToElement(element:IVisualElement, colorTransform:ColorTransform):void
NavigatorLayoutBase
 Inherited
calculateDragScrollDelta(dropLocation:DropLocation, elapsedTime:Number):Point
Calculates how much to scroll for the specified dropLocation during a drag and drop gesture.
LayoutBase
 Inherited
calculateDropIndex(x:Number, y:Number):int
Returns the index where a new item should be inserted if the user releases the mouse at the specified coordinates while completing a drag and drop gesture.
LayoutBase
 Inherited
Calculates the bounds for the drop indicator that provides visual feedback to the user of where the items will be inserted at the end of a drag and drop gesture.
LayoutBase
 Inherited
getElementBoundsAboveScrollRect(scrollRect:Rectangle):Rectangle
Returns the bounds of the first layout element that either spans or is above the scrollRect's top edge.
LayoutBase
 Inherited
getElementBoundsBelowScrollRect(scrollRect:Rectangle):Rectangle
Returns the bounds of the first layout element that either spans or is below the scrollRect's bottom edge.
LayoutBase
 Inherited
getElementBoundsLeftOfScrollRect(scrollRect:Rectangle):Rectangle
Returns the bounds of the first layout element that either spans or is to the left of the scrollRect's left edge.
LayoutBase
 Inherited
getElementBoundsRightOfScrollRect(scrollRect:Rectangle):Rectangle
Returns the bounds of the first layout element that either spans or is to the right of the scrollRect's right edge.
LayoutBase
 Inherited
getElementLayoutBoundsHeight(element:IVisualElement, postLayoutTransform:Boolean = true):Number
NavigatorLayoutBase
 Inherited
getElementLayoutBoundsWidth(element:IVisualElement, postLayoutTransform:Boolean = true):Number
NavigatorLayoutBase
 Inherited
Returns a reference to the views Scroller if there is one.
NavigatorLayoutBase
 Inherited
getScrollRect():Rectangle
Returns the bounds of the target's scroll rectangle in layout coordinates.
LayoutBase
 Inherited
indicesInView(firstIndexinView:int, numIndicesInView:int):void
NavigatorLayoutBase
 Inherited
invalidateSelectedIndex(index:int, offset:Number):void
[override]
AnimationNavigatorLayoutBase
 Inherited
NavigatorLayoutBase
  
[override] Restores the element to reset any changes to is visible properties.
CarouselLayout
 Inherited
[override]
NavigatorLayoutBase
 Inherited
setElementLayoutBoundsSize(element:IVisualElement, postLayoutTransform:Boolean = true):void
NavigatorLayoutBase
  
[override]
CarouselLayout
  
[override]
CarouselLayout
  
[override]
CarouselLayout
 Inherited
NavigatorLayoutBase
 Inherited
NavigatorLayoutBase
  
[override]  To be overridden in subclasses.
CarouselLayout
 Inherited
updateScrollBar(index:int, offset:Number):void
NavigatorLayoutBase
 Inherited
NavigatorLayoutBase
 Inherited
NavigatorLayoutBase
Events
 Event Summary Defined By
 Inherited The IndexChangeEvent.CHANGE constant defines the value of the type property of the event object for a change event, which indicates that an index has changed, such as when a List-based control changes its selection.NavigatorLayoutBase
 Inherited The FlexEvent.VALUE_COMMIT constant defines the value of the type property of the event object for a valueCommit event.NavigatorLayoutBase
Protected Constants
 ConstantDefined By
 InheritedDIRECT : String = direct
[static] An animationType value passed to the constructor.
AnimationNavigatorLayoutBase
 InheritedINDIRECT : String = indirect
[static] An animationType value passed to the constructor.
AnimationNavigatorLayoutBase
Property Detail
angleproperty
angle:Number

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

The segment of a circle to rotate the elements around.

The default value is 360.


Implementation
    public function get angle():Number
    public function set angle(value:Number):void
depthColorproperty 
depthColor:int

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

The color tint to apply to elements as their are moved back on the z axis.

If a valid color is added to elements are tinted as they are moved back on the z axis taking into account the depthColorAlpha specified. If a value of -1 is set for the color no tinting is applied.

The default value is -1.


Implementation
    public function get depthColor():int
    public function set depthColor(value:int):void

See also

depthColorAlphaproperty 
depthColorAlpha:Number

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

The alpha to be used for the color tint that is applied to elements as their are moved back on the z axis.

The default value is 1.


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

See also

elementHorizontalAlignproperty 
elementHorizontalAlign:String

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

The horizontal transform point of elements.

Valid values are HorizontalAlign.LEFT, HorizontalAlign.CENTER and HorizontalAlign.RIGHT.

The default value is "center".


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

See also

elementVerticalAlignproperty 
elementVerticalAlign:String

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

The vertical transform point of elements.

Valid values are VerticalAlign.TOP, VerticalAlign.MIDDLE and VerticalAlign.BOTTOM.

The default value is "middle".


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

See also

horizontalAlignproperty 
horizontalAlign:String

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

The horizontal position of the selected element in the viewport. All other elements are positioned around this element.

Valid values are HorizontalAlign.LEFT, HorizontalAlign.CENTER and HorizontalAlign.RIGHT.

The default value is "center".


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

See also

horizontalAlignOffsetproperty 
horizontalAlignOffset:Number

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

The offset in pixels to be used in conjunction with horizontalAlign to set the horizontal position of the selected element in the viewport. All other elements are positioned around this element.

If horizontalAlignOffsetPercent is set after this property, this property is set automatically depending on the value of horizontalAlignOffsetPercent.

The default value is 0.


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

See also

horizontalAlignOffsetPercentproperty 
horizontalAlignOffsetPercent:Number

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

The offset as a percentage of the unscaled width of the viewport to be used in conjunction with horizontalAlign to set the horizontal position of the selected element in the viewport. All other elements are positioned around this element.

Setting this property overrides any value set on horizontalAlignOffset.

The default value is 0.


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

See also

numUnselectedElementsproperty 
numUnselectedElements:int

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

The number of items to show either side of the selected item are positioned around this element.

Valid values are HorizontalAlign.LEFT, HorizontalAlign.CENTER and HorizontalAlign.RIGHT.

The default value is 2.


Implementation
    public function get numUnselectedElements():int
    public function set numUnselectedElements(value:int):void
radiusXproperty 
radiusX:Number

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

The radius to be used on the x axis for the SemiCarouselLayout.

The default value is 100.


Implementation
    public function get radiusX():Number
    public function set radiusX(value:Number):void
radiusYproperty 
radiusY:Number

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

The radius to be used on the y axis for the SemiCarouselLayout.

The default value is 0.


Implementation
    public function get radiusY():Number
    public function set radiusY(value:Number):void
radiusZproperty 
radiusZ:Number

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

The radius to be used on the z axis for the SemiCarouselLayout.

If a value of NaN is passed the largest of radiusX or radiusY is used.

The default value is NaN.


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

See also

rotateXproperty 
rotateX:String

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

Whether rotation should be applied to the x axis of elements.

The default value is true.


Implementation
    public function get rotateX():String
    public function set rotateX(value:String):void
rotateYproperty 
rotateY:String

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

Whether rotation should be applied to the y axis of elements.

The default value is true.


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

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

The vertical position of the selected element in the viewport. All other elements are positioned around this element.

Valid values are VerticalAlign.TOP, VerticalAlign.MIDDLE and VerticalAlign.BOTTOM.

The default value is "middle".


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

See also

verticalAlignOffsetproperty 
verticalAlignOffset:Number

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

The offset in pixels to be used in conjunction with verticalAlign to set the vertical position of the selected element in the viewport. All other elements are positioned around this element.

If verticalAlignOffsetPercent is set after this property, this property is set automatically depending on the value of verticalAlignOffsetPercent.

The default value is 0.


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

See also

verticalAlignOffsetPercentproperty 
verticalAlignOffsetPercent:Number

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

The offset as a percentage of the unscaled height of the viewport to be used in conjunction with verticalAlign to set the vertical position of the selected element in the viewport. All other elements are positioned around this element.

Setting this property overrides any value set on verticalAlignOffset.

The default value is 0.


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

See also

Constructor Detail
CarouselLayout()Constructor
public function CarouselLayout()

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

Constructor.

Method Detail
restoreElement()method
override protected function restoreElement(element:IVisualElement):void

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

Restores the element to reset any changes to is visible properties. This method should be overridden in a subclass to return any elements used in the layout to its default state when it is removed from the targets displayList or when the target is removed from the layout.

Parameters

element:IVisualElement — The element to be restored.

updateDisplayList()method 
override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

Sizes and positions the target's elements.

This is one of the methods that you must override when creating a subclass of LayoutBase. The other method is measure(). You do not call these methods directly. Flex calls this method as part of a layout pass. A layout pass consists of three phases.

First, if the target's properties are invalid, the LayoutManager calls the target's commitProperties method.

Second, if the target's size is invalid, LayoutManager calls the target's validateSize() method. The target's validateSize() will in turn call the layout's measure() to calculate the target's default size unless it was explicitly specified by both target's explicitWidth and explicitHeight properties. If the default size changes, Flex will invalidate the target's display list.

Last, if the target's display list is invalid, LayoutManager calls the target's validateDisplayList. The target's validateDisplayList will in turn call the layout's updateDisplayList method to size and position the target's elements.

A typical implementation iterates through the target's elements and uses the methods defined by the ILayoutElement to position and resize the elements. Then the layout must also calculate and set the target's contentWidth and contentHeight properties to define the target's scrolling region.

Parameters

unscaledWidth:Number — Specifies the width of the target, in pixels, in the targets's coordinates.
 
unscaledHeight:Number — Specifies the height of the component, in pixels, in the target's coordinates.

updateDisplayListBetween()method 
override protected function updateDisplayListBetween():void

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

updateDisplayListReal()method 
override protected function updateDisplayListReal():void

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

updateDisplayListVirtual()method 
override protected function updateDisplayListVirtual():void

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

updateIndicesInView()method 
override protected function updateIndicesInView():void

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

 To be overridden in subclasses. indicesInView() should be invoked in this method updating the first and last index in view.