Packagegraphics.display
Classpublic class TimelineInspector
InheritanceTimelineInspector Inheritance CoreEventDispatcher Inheritance Object

The TimelineInspector class use composition to dispatch action events during the MovieClip playing.

Example :

     package examples 
     {
         import graphics.display.TimelineInspector;
         import graphics.events.FrameLabelEvent;
         
         import flash.display.FrameLabel;
         import flash.display.MovieClip;
         import flash.display.Sprite;
         import flash.display.StageAlign;
         import flash.display.StageScaleMode;
         import flash.events.MouseEvent;
         import flash.utils.setTimeout;
         
         public dynamic class TestTimelineInspector extends Sprite
         {
              public function TestTimelineInspector()
              {
                  // stage
                  
                  stage.align      = StageAlign.TOP_LEFT ;
                  stage.scaleMode  = StageScaleMode.NO_SCALE ;
                  
                  // target
                  
                  mc               = getChildByName("mc") as MovieClip ; // MovieClip in the stage of the application
                  mc.useHandCursor = true ;
                  mc.buttonMode    = true ;
                  
                  mc.addEventListener( MouseEvent.CLICK , click ) ;
                  
                  trace("Click the movieclip to start the example.") ;
                  
                  // timeline inspector
                  
                  var inspector:TimelineInspector = new TimelineInspector( mc , true ) ;
                  inspector.addEventListener( FrameLabelEvent.FRAME_LABEL , frameLabel ) ;
                  
              }
              
              public var mc:MovieClip ;
              
              public function click( e:MouseEvent ):void
              {
                  mc.play() ;
              }
              
             public function frameLabel( e:FrameLabelEvent ):void
             {
                 var frame:FrameLabel = e.frameLabel ;
                 trace( "progress :: " + frame.frame + " : " + frame.name ) ;
                 switch( frame.name )
                 {
                     case "finish" :
                     {
                         mc.stop() ;
                         break ;
                     }
                     case "middle" :
                     {
                         mc.stop() ;
                         setTimeout(mc.play, 5000) ; // pause 5 seconds
                         break ;
                     }
                 }
             }
         }
     }
     



Public Properties
 PropertyDefined By
 Inheritedchannel : String
[read-only] Indicates the channel of this dispatcher if this instance is global.
CoreEventDispatcher
  frameLabel : Signal
[read-only] The signal to indicates if a new frame is inspected with a specific label.
TimelineInspector
  mode : String
Determinates the mode of the inspector.
TimelineInspector
  target : MovieClip
[read-only] Indicates the target reference of this iterator.
TimelineInspector
Public Methods
 MethodDefined By
  
TimelineInspector(target:MovieClip, autoStop:Boolean = false, mode:String = injector)
Creates a new TimelineInspector instance.
TimelineInspector
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0.0, useWeakReference:Boolean = false):void
Allows the registration of event listeners on the event target.
CoreEventDispatcher
 Inherited
dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow.
CoreEventDispatcher
  
dispose():void
Unregisters all notifications in the inspector.
TimelineInspector
 Inherited
Returns the internal system.events.EventDispatcher reference.
CoreEventDispatcher
 Inherited
hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
CoreEventDispatcher
  
initialize():void
Initialize the inspector.
TimelineInspector
 Inherited
isGlobal():Boolean
Indicates if the dispatcher use a global event flow.
CoreEventDispatcher
 Inherited
isLocked():Boolean
Returns true if the object is locked.
CoreEventDispatcher
 Inherited
lock():void
Locks the object.
CoreEventDispatcher
 Inherited
registerEventListener(type:String, listener:*, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Allows the registration of event listeners on the event target (Function or EventListener).
CoreEventDispatcher
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
CoreEventDispatcher
 Inherited
Sets the internal EventDispatcher reference.
CoreEventDispatcher
 Inherited
setGlobal(flag:Boolean = false, channel:String = null):void
Sets if the instance use a global system.events.EventDispatcher to dispatch this events, if the flag value is false the instance use a local EventDispatcher.
CoreEventDispatcher
 Inherited
unlock():void
Unlocks the display.
CoreEventDispatcher
 Inherited
unregisterEventListener(type:String, listener:*, useCapture:Boolean = false):void
Removes a listener (Function or EventListener object) from the EventDispatcher object.
CoreEventDispatcher
 Inherited
willTrigger(type:String):Boolean
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
CoreEventDispatcher
Protected Methods
 MethodDefined By
 Inherited
Creates and returns the internal EventDispatcher reference (this method is invoked in the constructor).
CoreEventDispatcher
Events
 Event Summary Defined By
  Dispatched when the inspector is in progress.TimelineInspector
Public Constants
 ConstantDefined By
  INJECTOR : String = injector
[static] The "injector" mode of the inspector.
TimelineInspector
  TIMELINE : String = timeline
[static] The "timeline" mode of the inspector.
TimelineInspector
Property Detail
frameLabelproperty
frameLabel:Signal  [read-only]

The signal to indicates if a new frame is inspected with a specific label.


Implementation
    public function get frameLabel():Signal
modeproperty 
mode:String

Determinates the mode of the inspector.

When the "injector" mode is defines, the events are dispatched with a set of methods injected in the timeline scripts.

When the "timeline" mode is defines, the user can use script in the frames of the MovieClip but the inspector use the Event.ENTER_FRAME event to dispatch the events (CPU usage).


Implementation
    public function get mode():String
    public function set mode(value:String):void
targetproperty 
target:MovieClip  [read-only]

Indicates the target reference of this iterator.


Implementation
    public function get target():MovieClip
Constructor Detail
TimelineInspector()Constructor
public function TimelineInspector(target:MovieClip, autoStop:Boolean = false, mode:String = injector)

Creates a new TimelineInspector instance.

Parameters
target:MovieClip — The MovieClip reference of this iterator.
 
autoStop:Boolean (default = false) — This boolean flag indicates if the specified MovieClip target reference is stopped when the inspector target the MovieClip reference.
 
mode:String (default = injector)

Throws
ArgumentError — if the target argument of this constructor is null.
Method Detail
dispose()method
public function dispose():void

Unregisters all notifications in the inspector.

initialize()method 
public function initialize():void

Initialize the inspector.

Event Detail
frameLabel Event
Event Object Type: graphics.events.FrameLabelEvent
FrameLabelEvent.type property = graphics.events.FrameLabelEvent.FRAME_LABEL

Dispatched when the inspector is in progress.

The name of the event when a frame label is found in a MovieClip during this playing process.
Constant Detail
INJECTORConstant
public static const INJECTOR:String = injector

The "injector" mode of the inspector.

TIMELINEConstant 
public static const TIMELINE:String = timeline

The "timeline" mode of the inspector.