Packageasgard.display
Classpublic class TimelineScript
InheritanceTimelineScript Inheritance CoreObject

The TimeLineScript class use composition to register script function over MovieClip timelines.

Example :

     import asgard.display.TimelineScript ;
     
     var ts:TimelineScript = new TimelineScript( mc , true ) ; // mc a MovieClip in the stage
     
     var start:Function = function()
     {
         trace("start") ;
     }
     
     var pause:Function = function()
     {
         trace("pause") ;
         mc.stop() ;
         setTimeout( mc.play , 4000 ) ; // pause 4 s
     }
     
     var finish:Function = function()
     {
         trace("finish") ;
         mc.stop() ;
     }
     
     ts.put( "begin"   , start ) ;
     ts.put( "middle"  , pause ) ;
     ts.put( "finish"  , finish ) ;
     
     var click:Function = function( e:MouseEvent ):void
     {
         mc.play() ;
         trace("click") ;
         e.target.removeEventListener( MouseEvent.CLICK , click ) ;
         mc.buttonMode = false ;
     }
     
     mc.useHandCursor = true ;
     mc.buttonMode    = true ;
     mc.addEventListener( MouseEvent.CLICK , click ) ;
     



Public Properties
 PropertyDefined by
  target : MovieClip
[read-only] (read-only) Indicates the target reference of this iterator.
TimelineScript
Public Methods
 MethodDefined by
  
TimelineScript(target:MovieClip, autoStop:Boolean = false)
Creates a new TimelineScript instance.
TimelineScript
 Inherited
Returns the internal ILogger reference of this ILogable object.
CoreObject
 Inherited
hashCode():uint
Returns a hashcode value for the object.
CoreObject
  
put(index:*, script:Function):Boolean
Registers a script function in the frame specified by the label or index value passed-in the first argument of the method.
TimelineScript
  
remove(index:*):void
Unregisters a script function in the frame specified by the label or index value passed-in argument of the method.
TimelineScript
 Inherited
setLogger(log:ILogger = null):void
Sets the internal ILogger reference of this ILogable object.
CoreObject
 Inherited
toSource(indent:int = 0):String
Returns the string representation the source code of the object.
CoreObject
 Inherited
toString():String
Returns the string representation of this instance.
CoreObject
Protected Methods
 MethodDefined by
  
resolve(label:String = null):int
Indicates if the specified passed-in label value is in the MovieClip target.
TimelineScript
Property detail
targetproperty
target:MovieClip  [read-only]

(read-only) Indicates the target reference of this iterator.

Implementation
    public function get target():MovieClip
Constructor detail
TimelineScript()constructor
public function TimelineScript(target:MovieClip, autoStop:Boolean = false)

Creates a new TimelineScript 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.
Method detail
put()method
public function put(index:*, script:Function):Boolean

Registers a script function in the frame specified by the label or index value passed-in the first argument of the method.

Parameters
index:* — A String label name or a uint frame index value.
 
script:Function — The Function instruction to register.

Returns
Boolean — true if the register is success.
remove()method 
public function remove(index:*):void

Unregisters a script function in the frame specified by the label or index value passed-in argument of the method.

Parameters
index:* — A String label name or a uint frame index value.
resolve()method 
protected function resolve(label:String = null):int

Indicates if the specified passed-in label value is in the MovieClip target.

Parameters
label:String (default = null)

Returns
int