| Package | mx.containers |
| Class | public class TabNavigator |
| Inheritance | TabNavigator ViewStack Container UIComponent FlexSprite Sprite DisplayObjectContainer InteractiveObject DisplayObject EventDispatcher Object |
| Implements | IFocusManagerComponent |
Like a ViewStack container, a TabNavigator container has a collection of child containers, in which only one child at a time is visible. Flex automatically creates a TabBar container at the top of the TabNavigator container, with a tab corresponding to each child container. Each tab can have its own label and icon. When the user clicks a tab, the corresponding child container becomes visible as the selected child of the TabNavigator container.
When you change the currently visible child container,
you can use the hideEffect property of the container being
hidden and the showEffect property of the newly visible child
container to apply an effect to the child containers.
The TabNavigator container waits for the hideEffect of the
child container being hidden to complete before it reveals the new child
container.
You can interrupt a currently playing effect if you change the
selectedIndex property of the TabNavigator container
while an effect is playing.
To define the appearance of tabs in a TabNavigator, you can define style properties in a Tab type selector, as the following example shows:
<mx:Style>
Tab {
fillColors: #006699, #cccc66;
upSkin: ClassReference("CustomSkinClass");
overSkin: ClassReference("CustomSkinClass");
downSkin: ClassReference("CustomSkinClass");
}
</mx:Style>
The Tab type selector defines values on the hidden mx.controls.tabBarClasses.Tab class. The default values for the Tab type selector are defined in the defaults.css file.
You can also define the styles in a class selector that you specify using
the tabStyleName style property; for example:
<mx:Style>
TabNavigator {
tabStyleName:myTabStyle;
}
.myTabStyle {
fillColors: #006699, #cccc66;
upSkin: ClassReference("CustomSkinClass");
overSkin: ClassReference("CustomSkinClass");
downSkin: ClassReference("CustomSkinClass");
}
</mx:Style>
MXML Syntax
Hide MXML Syntax
The <mx:TabNavigator> tag inherits all of the
tag attributes of its superclass,
and adds the following tag attributes:
<mx:TabNavigator
Styles
fillAlphas="[0.60, 0.40, 0.75, 0.65]"
fillColors="[0xFFFFFF, 0xCCCCCC, 0xFFFFFF, 0xEEEEEE]"
firstTabStyleName="Value of the tabStyleName property"
focusAlpha="0.4"
focusRoundedCorners="tl tr bl br"
horizontalAlign="left|center|right"
horizontalGap="-1"
lastTabStyleName="Value of the tabStyleName property"
selectedTabTextStyleName="undefined"
tabHeight="undefined"
tabStyleName="Name of CSS style declaration that specifies styles for the tabs"
tabWidth="undefined"
>
...
child tags
...
</mx:TabNavigator>
See also
| Property | Defined by | ||
|---|---|---|---|
![]() | actualCreationPolicy : String
The creation policy of this container.
| Container | |
![]() | contentHeight : Number
The height of the area, in pixels, in which content is displayed.
| ViewStack | |
![]() | contentWidth : Number
The width of the area, in pixels, in which content is displayed.
| ViewStack | |
![]() | contentX : Number
The x coordinate of the area of the ViewStack container
in which content is displayed, in pixels.
| ViewStack | |
![]() | contentY : Number
The y coordinate of the area of the ViewStack container
in which content is displayed, in pixels.
| ViewStack | |
| tabBar : TabBar
A reference to the TabBar inside this TabNavigator.
| TabNavigator | ||
![]() | unscaledHeight : Number
A convenience method for determining the unscaled height
of the component
All of a component's drawing and child layout should be done
within a bounding rectangle of this height, which is also passed
as an argument to
updateDisplayList(). | UIComponent | |
![]() | unscaledWidth : Number
A convenience method for determining the unscaled width
of the component
All of a component's drawing and child layout should be done
within a bounding rectangle of this width, which is also passed
as an argument to
updateDisplayList(). | UIComponent | |
| Method | Defined by | ||
|---|---|---|---|
|
Constructor.
| TabNavigator | ||
![]() |
Adds a child DisplayObject to this Container.
| Container | |
![]() |
Adds a child DisplayObject to this Container.
| Container | |
![]() |
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 | |
![]() |
Indicates whether the security restrictions
would cause any display objects to be omitted from the list returned by calling
the
DisplayObjectContainer.getObjectsUnderPoint() method
with the specified point point. | DisplayObjectContainer | |
![]() |
Queues a function to be called later.
| UIComponent | |
![]() |
clearStyle(styleProp:String):void
Deletes a style property from this component instance.
| UIComponent | |
![]() |
Determines whether the specified display object is a child of the DisplayObjectContainer instance or
the instance itself.
| DisplayObjectContainer | |
![]() |
Converts a
Point object from content coordinates to global coordinates. | Container | |
![]() |
Converts a
Point object from content to local coordinates. | Container | |
![]() |
Returns a set of properties that identify the child within
this container.
| UIComponent | |
![]() |
Given a single UIComponentDescriptor, create the corresponding
component and add the component as a child of this Container.
| Container | |
![]() |
createComponentsFromDescriptors(recurse:Boolean = true):void
Iterate through the Array of
childDescriptors,
and call the createComponentFromDescriptor() method for each one. | Container | |
![]() |
createReferenceOnParentDocument(parentDocument:IFlexDisplayObject):void
Creates an
id reference to this IUIComponent object
on its parent document object. | UIComponent | |
![]() |
deleteReferenceOnParentDocument(parentDocument:IFlexDisplayObject):void
Deletes the
id reference to this IUIComponent object
on its parent document object. | UIComponent | |
![]() |
Returns a UITextFormat object corresponding to the text styles
for this UIComponent.
| UIComponent | |
![]() | UIComponent | ||
![]() |
Shows or hides the focus indicator around this component.
| UIComponent | |
![]() |
drawRoundRect(x:Number, y:Number, width:Number, height:Number, cornerRadius:Object = null, color:Object = null, alpha:Object = null, gradientMatrix:Matrix = null, gradientType:String = "linear", gradientRatios:Array = null, hole:Object = null):void
Programatically draws a rectangle into this skin's Graphics object.
| UIComponent | |
![]() |
effectFinished(effectInst:EffectInstance):void
Called by the effect instance when it stops playing on the component.
| UIComponent | |
![]() |
effectStarted(effectInst:EffectInstance):void
Called by the effect instance when it starts playing on the component.
| UIComponent | |
![]() |
endEffectsStarted():void
Ends all currently playing effects on the component.
| UIComponent | |
![]() |
executeBindings(recurse:Boolean = false):void
Executes all the data bindings on this Container.
| Container | |
![]() |
executeChildBindings(recurse:Boolean):void
Executes the bindings into this Container's child UIComponent objects.
| Container | |
![]() |
Called after printing is complete.
| UIComponent | |
![]() |
Provides the automation object at the specified index.
| UIComponent | |
![]() |
Returns a rectangle that defines the area of the display object relative to the coordinate system
of the
targetCoordinateSpace object. | DisplayObject | |
![]() |
Gets the nth child component object.
| Container | |
![]() |
Returns the child whose
name property is the specified String. | Container | |
![]() |
Gets the zero-based index of a specific child.
| Container | |
![]() |
Returns an Array of DisplayObject objects consisting of the content children
of the container.
| Container | |
![]() |
Finds the type selectors for this UIComponent instance.
| UIComponent | |
![]() |
A convenience method for determining whether to use the
explicit or measured height
| UIComponent | |
![]() |
A convenience method for determining whether to use the
explicit or measured width
| UIComponent | |
![]() |
Gets the object that currently has focus.
| UIComponent | |
![]() |
Returns an array of objects that lie under the specified point and are children
(or grandchildren, and so on) of this DisplayObjectContainer instance.
| DisplayObjectContainer | |
![]() |
Returns a rectangle that defines the boundary of the display object,
based on the coordinate system defined by the
targetCoordinateSpace
parameter, excluding any strokes on shapes. | DisplayObject | |
![]() |
Returns the item in the
dataProvider that was used
by the specified Repeater to produce this Repeater, or
null if this Repeater isn't repeated. | UIComponent | |
![]() |
Gets a style property that has been set anywhere in this
component's style lookup chain.
| UIComponent | |
|
Returns the tab of the navigator's TabBar control at the specified
index.
| TabNavigator | ||
![]() |
Converts a
Point object from global to content coordinates. | Container | |