Packagespark.transitions
Classpublic class ViewTransitionBase
InheritanceViewTransitionBase Inheritance flash.events.EventDispatcher
Subclasses CrossFadeViewTransition, FlipViewTransition, SlideViewTransition, ZoomViewTransition

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

The ViewTransitionBase class is the base class for all view transitions. It is not intended to be used as a transition on its own. In addition to providing common convenience and helper methods used by view transitions, this class provides a default action bar transition sequence.

When a view transition is initialized, the owning view navigator sets the startView and endView properties to the views the transition animates. The navigator property is set to the view navigator.

The lifecycle of a transition is as follows:

Note:Create and configure view transitions in ActionScript; you cannot create them in MXML.



Public Properties
 PropertyDefined By
  AIR-only duration : Number
Duration of the transition, in milliseconds.
ViewTransitionBase
  AIR-only easer : IEaser
The easing behavior for this transition.
ViewTransitionBase
  AIR-only endView : View
The view that the navigator is transitioning to, as set by the owning ViewNavigator object.
ViewTransitionBase
  AIR-only navigator : ViewNavigator
Reference to the owning ViewNavigator instance set by the owning ViewNavigator.
ViewTransitionBase
  AIR-only startView : View
The currently active view of the view navigator, as set by the owning view navigator.
ViewTransitionBase
  AIR-only suspendBackgroundProcessing : Boolean
When set to true, the UIComponent.suspendBackgroundProcessing() method is invoked prior to the transition playing.
ViewTransitionBase
  AIR-only transitionControlsWithContent : Boolean
When set to true, the primary view transition is used to transition the view navigator in its entirety, including the action bar.
ViewTransitionBase
Public Methods
 MethodDefined By
  
Constructor.
ViewTransitionBase
  
Called by the ViewNavigator during the preparation phase of a transition.
ViewTransitionBase
  
Called by the ViewNavigator during the preparation phase of a transition.
ViewTransitionBase
  
AIR-only play():void
Called by the ViewNavigator when the transition should begin animating.
ViewTransitionBase
  
Called by the ViewNavigator during the preparation phase of a transition.
ViewTransitionBase
Protected Methods
 MethodDefined By
  
Determine if Flex can perform a transition on action bar or tab bar content independently of the views.
ViewTransitionBase
  
AIR-only cleanUp():void
Called after the transition completes.
ViewTransitionBase
  
Called by the default prepareForPlay() implementation, this method is responsible for creating the Spark effect played on the action bar when the transition starts.
ViewTransitionBase
  
Called by the default prepareForPlay() implementation, this method is responsible for creating the Spark effect played to transition the entire navigator, inclusive of the control bar content, when necessary.
ViewTransitionBase
  
Called by the default prepareForPlay() implementation, this method is responsible for creating the Spark effect played on the tab bar when the transition starts.
ViewTransitionBase
  
Called by the default prepareForPlay() implementation, this method is responsible for creating the Spark effect played on the current and next view when the transition starts.
ViewTransitionBase
  
AIR-only getSnapshot(target:UIComponent, padding:int = 4, globalPosition:Point = null):BitmapImage
Used to render snap shots of screen elements in preparation for transitioning.
ViewTransitionBase
  
Called by the transition to indicate that the transition has completed.
ViewTransitionBase
Events
 Event Summary Defined By
  Dispatched when the transition completes.ViewTransitionBase
  Dispatched when the transition starts.ViewTransitionBase
Property Detail
AIR-only durationproperty
duration:Number

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

Duration of the transition, in milliseconds. The default may vary depending on the transition but is defined in ViewTransitionBase as 250 ms.


Implementation
    public function get duration():Number
    public function set duration(value:Number):void
AIR-only easerproperty 
easer:IEaser

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

The easing behavior for this transition. The IEaser object is generally propagated to the IEffect instance managing the actual transition animation.

The default value is Sine(.5);.


Implementation
    public function get easer():IEaser
    public function set easer(value:IEaser):void

See also

AIR-only endViewproperty 
endView:View

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

The view that the navigator is transitioning to, as set by the owning ViewNavigator object. This property can be null.

The default value is null.


Implementation
    public function get endView():View
    public function set endView(value:View):void
AIR-only navigatorproperty 
navigator:ViewNavigator

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

Reference to the owning ViewNavigator instance set by the owning ViewNavigator.

The default value is null.


Implementation
    public function get navigator():ViewNavigator
    public function set navigator(value:ViewNavigator):void
AIR-only startViewproperty 
startView:View

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

The currently active view of the view navigator, as set by the owning view navigator. This property can be null.


Implementation
    public function get startView():View
    public function set startView(value:View):void
AIR-only suspendBackgroundProcessingproperty 
suspendBackgroundProcessing:Boolean

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

When set to true, the UIComponent.suspendBackgroundProcessing() method is invoked prior to the transition playing. This disables Flex's layout manager and improving performance. Upon completion of the transition, the layout manager function is restored by a call to the UIComponent.resumeBackgroundProcessing() method.

The default value is false.


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

See also

AIR-only transitionControlsWithContentproperty 
transitionControlsWithContent:Boolean

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

When set to true, the primary view transition is used to transition the view navigator in its entirety, including the action bar. Specific transitions for the action bar are not performed. Because the tab bar is associated with the entire application, and not a view, view transitions do not affect it.

Note that even when set to false, there are cases where its not feasible to transition the action bar. For example, when the action bar does not exist in one of the two views, or if the action bar changes size.

The default value is false.


Implementation
    public function get transitionControlsWithContent():Boolean
    public function set transitionControlsWithContent(value:Boolean):void
Constructor Detail
AIR-only ViewTransitionBase()Constructor
public function ViewTransitionBase()

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

Constructor.

Method Detail
AIR-only canTransitionControlBarContent()method
protected function canTransitionControlBarContent():Boolean

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

Determine if Flex can perform a transition on action bar or tab bar content independently of the views.

Flex cannot perform a transition on the control bars independently:

Returns
Booleanfalse if Flex determines controls bars between views are incompatible in some way.
AIR-only captureEndValues()method 
public function captureEndValues():void

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

Called by the ViewNavigator during the preparation phase of a transition. It is invoked when the new view has been fully realized and validated and the action bar and tab bar content reflect the state of the new view. It is at this point that the transition can capture any values it requires from the pending view. In addition any bitmaps reflecting the state of the new view, tab bar, or action bar should be captured, if required for animation.

AIR-only captureStartValues()method 
public function captureStartValues():void

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

Called by the ViewNavigator during the preparation phase of a transition. It is invoked when the new view has been fully realized and validated and the action bar and tab bar content reflect the state of the new view. The transition can use this method capture any values it requires from the pending view. Any bitmaps reflecting the state of the new view, tab bar, or action bar should be captured if required for animation.

AIR-only cleanUp()method 
protected function cleanUp():void

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

Called after the transition completes. This method is responsible for releasing any references and temporary constructs used by the transition.

AIR-only createActionBarEffect()method 
protected function createActionBarEffect():IEffect

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

Called by the default prepareForPlay() implementation, this method is responsible for creating the Spark effect played on the action bar when the transition starts. This method should be overridden by subclasses if a custom action bar effect is required. By default, this method returns a basic action bar effect.

Returns
IEffect — An IEffect instance serving as the action bar effect. This effect is played by the default play() method implementation.
AIR-only createConsolidatedEffect()method 
protected function createConsolidatedEffect():IEffect

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

Called by the default prepareForPlay() implementation, this method is responsible for creating the Spark effect played to transition the entire navigator, inclusive of the control bar content, when necessary. This method should be overridden by subclasses. By default, this method returns null.

Returns
IEffect — An IEffect instance serving as the view transition. This effect is played by the default play() method implementation.
AIR-only createTabBarEffect()method 
protected function createTabBarEffect():IEffect

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

Called by the default prepareForPlay() implementation, this method is responsible for creating the Spark effect played on the tab bar when the transition starts. This method should be overridden by subclasses. By default, this returns null.

Returns
IEffect — An IEffect instance serving as the tab bar transition. This effect is played by the default play() method implementation.
AIR-only createViewEffect()method 
protected function createViewEffect():IEffect

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

Called by the default prepareForPlay() implementation, this method is responsible for creating the Spark effect played on the current and next view when the transition starts. This method should be overridden by subclasses. By default, this method returns null.

Returns
IEffect — An IEffect instance serving as the view transition. This effect is played by the default play() method implementation.
AIR-only getSnapshot()method 
protected function getSnapshot(target:UIComponent, padding:int = 4, globalPosition:Point = null):BitmapImage

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

Used to render snap shots of screen elements in preparation for transitioning. The bitmap is returned in the form of a BitmapImage object.

The BitmapImage is in target's parent coordiantes space - it overlaps the target precisely if paranted to the same parent. When moving to a different parent, make sure to adjust the transformation of the BitmapImage to correctly account for the change in coordinate spaces. The updated value of the globalPosition parameter can be used for that.

Parameters

target:UIComponent — Display object to capture.
 
padding:int (default = 4) — Padding around the object to be included in the BitmapImage object.
 
globalPosition:Point (default = null) — When non-null, globalPosition will be updated with the origin of the BitmapImage in global coordiantes. When moving to a different coordinate space, this value can be used to adjust the snapshot's position so its global position on screen doesn't change.

Returns
BitmapImage — BitmapImage object representing the target.
AIR-only play()method 
public function play():void

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

Called by the ViewNavigator when the transition should begin animating. At this time, the transition should dispatch a start event.

AIR-only prepareForPlay()method 
public function prepareForPlay():void

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

Called by the ViewNavigator during the preparation phase of a transition. This method gives the transition the chance to create and configure the underlying IEffect instance, or to add any transient elements to the display list. Example transient elements include bitmap placeholders, temporary containers required during the transition, and other elements. If required, a final validation pass occurs prior to the invocation of the play() method.

If it is determined that a standard transition can be initiated, meaning one that transitions the control bars separately from the views, the default implementation of this method constructs a single Parallel effect which wraps the individual effect sequences for the view transition, the action bar transition, and the tab bar transition. This method uses the methods, createActionBarEffect(), createTabBarEffect(), and createViewEffect().

If transitionControlsWithContent is set to true, or if it is determined that the control bars cannot be transitioned independently, a single effect is created to transition the navigator in its entirety. In this case, only createConsolidatedEffect() is invoked.

AIR-only transitionComplete()method 
protected function transitionComplete():void

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

Called by the transition to indicate that the transition has completed. This method dispatches the end event.

Event Detail
AIR-only transitionEnd Event
Event Object Type: mx.events.FlexEvent
FlexEvent.type property = mx.events.FlexEvent.TRANSITION_START

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

Dispatched when the transition completes.

The FlexEvent.TRANSITION_START constant defines the value of the type property of the event object for a transitionStart event.

This event will only be dispatched when there are one or more relevant listeners attached to the dispatching object.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
AIR-only transitionStart Event  
Event Object Type: mx.events.FlexEvent
FlexEvent.type property = mx.events.FlexEvent.TRANSITION_START

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : AIR 2.5

Dispatched when the transition starts.

The FlexEvent.TRANSITION_START constant defines the value of the type property of the event object for a transitionStart event.

This event will only be dispatched when there are one or more relevant listeners attached to the dispatching object.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.