| Package | graphics.display |
| Class | public class TimelineInspector |
| Inheritance | TimelineInspector CoreEventDispatcher Object |
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 ;
}
}
}
}
}
| Property | Defined By | ||
|---|---|---|---|
![]() | channel : 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 | ||
| Method | Defined By | ||
|---|---|---|---|
TimelineInspector(target:MovieClip, autoStop:Boolean = false, mode:String = injector)
Creates a new TimelineInspector instance. | TimelineInspector | ||
![]() | 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 | |
![]() | dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow. | CoreEventDispatcher | |
dispose():void
Unregisters all notifications in the inspector. | TimelineInspector | ||
![]() |
Returns the internal system.events.EventDispatcher reference. | CoreEventDispatcher | |
![]() | 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 | ||
![]() | isGlobal():Boolean
Indicates if the dispatcher use a global event flow. | CoreEventDispatcher | |
![]() | isLocked():Boolean
Returns true if the object is locked. | CoreEventDispatcher | |
![]() | lock():void
Locks the object. | CoreEventDispatcher | |
![]() | 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 | |
![]() | removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object. | CoreEventDispatcher | |
![]() | setEventDispatcher(dispatcher:EventDispatcher):void
Sets the internal EventDispatcher reference. | CoreEventDispatcher | |
![]() | 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 | |
![]() | unlock():void
Unlocks the display. | CoreEventDispatcher | |
![]() | unregisterEventListener(type:String, listener:*, useCapture:Boolean = false):void
Removes a listener (Function or EventListener object) from the EventDispatcher object. | CoreEventDispatcher | |
![]() | 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 | |
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when the inspector is in progress. | TimelineInspector | |||
| Constant | Defined By | ||
|---|---|---|---|
| INJECTOR : String = injector [static]
The "injector" mode of the inspector. | TimelineInspector | ||
| TIMELINE : String = timeline [static]
The "timeline" mode of the inspector. | TimelineInspector | ||
| frameLabel | property |
frameLabel:Signal [read-only] The signal to indicates if a new frame is inspected with a specific label.
public function get frameLabel():Signal| mode | property |
mode:StringDeterminates 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).
public function get mode():String public function set mode(value:String):void| target | property |
target:MovieClip [read-only] Indicates the target reference of this iterator.
public function get target():MovieClip| TimelineInspector | () | Constructor |
public function TimelineInspector(target:MovieClip, autoStop:Boolean = false, mode:String = injector)Creates a new TimelineInspector instance.
Parameterstarget: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) |
ArgumentError — if the target argument of this constructor is null.
|
| dispose | () | method |
public function dispose():voidUnregisters all notifications in the inspector.
| initialize | () | method |
public function initialize():voidInitialize the inspector.
| frameLabel | Event |
graphics.events.FrameLabelEventgraphics.events.FrameLabelEvent.FRAME_LABELDispatched when the inspector is in progress.
The name of the event when a frame label is found in a MovieClip during this playing process.| INJECTOR | Constant |
public static const INJECTOR:String = injectorThe "injector" mode of the inspector.
| TIMELINE | Constant |
public static const TIMELINE:String = timelineThe "timeline" mode of the inspector.