Packagegraphics.display
Classpublic class TimelineTransition
InheritanceTimelineTransition Inheritance CoreTransition Inheritance CoreAction Inheritance Task Inheritance Object

This transition check the frames in the timeline of a specific MovieClip reference and notify a finish and start events between two specific frames.

Example :

     package examples 
     {
         import graphics.display.TimelineTransition;
         
         import system.events.ActionEvent;
         
         import flash.display.MovieClip;
         import flash.display.Sprite;
         import flash.display.StageScaleMode;
         import flash.events.KeyboardEvent;
         import flash.ui.Keyboard;
         
         public dynamic class TimelineTransition01Example extends Sprite 
         {
             public function TimelineTransition01Example()
             {
                 // stage
                 
                 stage.scaleMode  = StageScaleMode.NO_SCALE ;
                 
                 stage.addEventListener( KeyboardEvent.KEY_DOWN , keyDown ) ;
                 
                 // MovieClip target with the three frame labels : 
                 // "start", "middle" and "finish"
                 
                 movieclip = getChildByName("mc") as MovieClip ;
                 
                 // timeline script
                 
                 timeline = new TimelineTransition( movieclip ) ;
                 
                 timeline.defaultIndex = 4 ; // by default stop the MovieClip in the frame index 4.
                 
                 timeline.addEventListener( ActionEvent.FINISH , finish ) ;
                 timeline.addEventListener( ActionEvent.RESUME , resume ) ;
                 timeline.addEventListener( ActionEvent.START  , start  ) ;
             }
             
             protected var movieclip:MovieClip ;
             protected var timeline:TimelineTransition ;
             
             protected function finish( e:ActionEvent ):void
             {
                 trace( "finish" ) ;
             }
             
             protected function keyDown( e:KeyboardEvent ):void
             {
                 var code:uint = e.keyCode ;
                 switch( code )
                 {
                     case Keyboard.UP :
                     {
                         timeline.startIndex  = "middle" ;
                         timeline.finishIndex = "finish" ;
                         timeline.run() ;
                         break ;
                     }
                     case Keyboard.DOWN :
                     {
                         timeline.startIndex  = "start" ;
                         timeline.finishIndex = "middle" ;
                         timeline.run() ;
                         break ;
                     }
                     case Keyboard.SPACE :
                     {
                         timeline.startIndex  = "start" ;
                         timeline.finishIndex = "finish" ;
                         timeline.run() ;
                         break ;
                     }
                     case Keyboard.LEFT :
                     {
                         if ( timeline.running )
                         { 
                             timeline.stop() ;
                         }
                         else if ( timeline.stopped )
                         {
                             timeline.resume() ;
                         }
                         else
                         {
                             timeline.start() ;
                         }
                         break ;
                     }
                 }
             }
             
             protected function resume( e:ActionEvent ):void
             {
                 trace( "resume" ) ;
             }
             
             protected function start( e:ActionEvent ):void
             {
                 trace( "start" ) ;
             }
         }
     }
     



Public Properties
 PropertyDefined By
 InheritedchangeIt : Signaler
This signal emit when the notifyChanged method is invoked.
CoreAction
 InheritedclearIt : Signaler
This signal emit when the notifyCleared method is invoked.
CoreAction
  currentLoop : uint
[read-only] Indicates the current countdown loop value.
TimelineTransition
  defaultIndex : *
This index defines the default frame to stop the timeline of the MovieClip target.
TimelineTransition
  finishIndex : *
Indicates the finish index.
TimelineTransition
 InheritedfinishIt : Signaler
This signal emit when the notifyFinished method is invoked.
Task
  frameScripts : Array
An optional Array of framescripts to add in the MovieClip target during the transition.
TimelineTransition
 Inheritedid : *
Indicates the id value of this object.
CoreTransition
 InheritedinfoIt : Signaler
This signal emit when the notifyInfo method is invoked.
CoreAction
 Inheritedlogger : Logger
Determinates the internal Logger reference of this Loggable object.
Task
 Inheritedlooping : Boolean
The flag to determinate if the Action object is looped.
CoreAction
 InheritedloopIt : Signaler
This signal emit when the notifyLooped method is invoked.
CoreAction
  numLoop : uint
Specifies the number of the times the presentation should loop during playback.
TimelineTransition
 InheritedpauseIt : Signaler
This signal emit when the notifyPause method is invoked.
CoreAction
 Inheritedphase : String
[read-only] The current phase of the action.
Task
 InheritedprogressIt : Signaler
This signal emit when the notifyProgress method is invoked.
CoreAction
 InheritedresumeIt : Signaler
This signal emit when the notifyResumed method is invoked.
CoreAction
 Inheritedrunning : Boolean
[read-only] Indicates true if the process is in progress.
Task
  startIndex : *
Indicates the start index.
TimelineTransition
 InheritedstartIt : Signaler
This signal emit when the notifyStarted method is invoked.
Task
 InheritedstopIt : Signaler
This signal emit when the notifyStopped method is invoked.
CoreAction
  stopped : Boolean
[read-only] Indicates if the process is stopped.
TimelineTransition
  target : MovieClip
The MovieClip target reference.
TimelineTransition
 InheritedtimeoutIt : Signaler
This signal emit when the notifyTimeOut method is invoked.
CoreAction
  verbose : Boolean
Enables the verbose mode of this object.
TimelineTransition
Public Methods
 MethodDefined By
  
TimelineTransition(target:MovieClip = null, startIndex:* = null, finishIndex:* = null, looping:Boolean = false, numLoop:uint = 0, defaultIndex:* = 1, frameScripts:Array = null)
Creates a new TimelineTransition instance.
TimelineTransition
  
clone():*
[override] Returns a shallow copy of this object.
TimelineTransition
 Inherited
equals(o:*):Boolean
Compares the specified object with this object for equality.
CoreTransition
 Inherited
isLocked():Boolean
Returns true if the object is locked.
Task
 Inherited
lock():void
Locks the object.
Task
 Inherited
Notify when the process is changed.
CoreAction
 Inherited
Notify when the process is cleared.
CoreAction
 Inherited
Notify an ActionEvent when the process is finished.
Task
 Inherited
notifyInfo(info:*):void
Notify a specific information when the process is changed.
CoreAction
 Inherited
Notify when the process is looped.
CoreAction
 Inherited
Notify when the process is paused.
CoreAction
 Inherited
Notify when the process is in progress.
CoreAction
 Inherited
Notify when the process is resumed.
CoreAction
 Inherited
Notify an ActionEvent when the process is started.
Task
 Inherited
Notify when the process is stopped.
CoreAction
 Inherited
Notify when the process is out of time.
CoreAction
  
resume():void
[override] Restart the process if the process is stopped.
TimelineTransition
  
run(... arguments):void
[override] Run the process.
TimelineTransition
  
start():void
[override] Starts the transition.
TimelineTransition
  
stop():void
[override] Stops the transition.
TimelineTransition
 Inherited
unlock():void
Unlocks the display.
Task
Protected Methods
 MethodDefined By
  
finish():void
Invoked when a specific frame is find in the timeline by the timeline inspector.
TimelineTransition
  
playback():void
Starts the playback of the target with the specified start index.
TimelineTransition
 Inherited
setRunning(b:Boolean):void
Changes the running property value.
Task
Property Detail
currentLoopproperty
currentLoop:uint  [read-only]

Indicates the current countdown loop value.


Implementation
    public function get currentLoop():uint
defaultIndexproperty 
defaultIndex:*

This index defines the default frame to stop the timeline of the MovieClip target.


Implementation
    public function get defaultIndex():*
    public function set defaultIndex(value:any):void
finishIndexproperty 
finishIndex:*

Indicates the finish index.


Implementation
    public function get finishIndex():*
    public function set finishIndex(value:any):void
frameScriptsproperty 
public var frameScripts:Array

An optional Array of framescripts to add in the MovieClip target during the transition.

numLoopproperty 
public var numLoop:uint

Specifies the number of the times the presentation should loop during playback.

startIndexproperty 
startIndex:*

Indicates the start index.


Implementation
    public function get startIndex():*
    public function set startIndex(value:any):void
stoppedproperty 
stopped:Boolean  [read-only]

Indicates if the process is stopped. You can resume a stopped transition.


Implementation
    public function get stopped():Boolean
targetproperty 
target:MovieClip

The MovieClip target reference.


Implementation
    public function get target():MovieClip
    public function set target(value:MovieClip):void
verboseproperty 
public var verbose:Boolean

Enables the verbose mode of this object.

Constructor Detail
TimelineTransition()Constructor
public function TimelineTransition(target:MovieClip = null, startIndex:* = null, finishIndex:* = null, looping:Boolean = false, numLoop:uint = 0, defaultIndex:* = 1, frameScripts:Array = null)

Creates a new TimelineTransition instance.

Parameters
target:MovieClip (default = null) — The MovieClip target reference.
 
startIndex:* (default = null) — The start index.
 
finishIndex:* (default = null) — The finish index.
 
looping:Boolean (default = false) — Specifies whether playback of the clip should continue, or loop (default false).
 
numLoop:uint (default = 0) — Specifies the number of the times the presentation should loop during playback.
 
defaultIndex:* (default = 1) — This index defines the default frame to stop the timeline of the MovieClip target.
 
frameScripts:Array (default = null) — The optional Array of frame scripts.
Method Detail
clone()method
override public function clone():*

Returns a shallow copy of this object.

Returns
* — a shallow copy of this object.
finish()method 
protected function finish():void

Invoked when a specific frame is find in the timeline by the timeline inspector.

playback()method 
protected function playback():void

Starts the playback of the target with the specified start index.

resume()method 
override public function resume():void

Restart the process if the process is stopped.

run()method 
override public function run(... arguments):void

Run the process.

Parameters

... arguments

start()method 
override public function start():void

Starts the transition.

stop()method 
override public function stop():void

Stops the transition.