| Package | asgard.display |
| Class | public class TimelineIterator |
| Inheritance | TimelineIterator CoreObject |
| Implements | OrderedIterator |
Example :With container a MovieClip reference added in the stage of the application, this MovieClip contains 10 frames
import asgard.display.TimelineIterator ;
var it:TimelineIterator = new TimelineIterator( container , 2 ) ;
trace( "timeline current frame : " + it.currentFrame ) ;
trace( "timeline total frames : " + it.totalFrames ) ;
var keyDown:Function = function( e:KeyboardEvent ):void
{
var code:uint = e.keyCode ;
switch(code)
{
case Keyboard.LEFT :
{
if ( it.hasPrevious() )
{
it.previous() ;
}
else
{
it.last() ;
}
break ;
}
case Keyboard.RIGHT :
{
if ( it.hasNext() )
{
it.next() ;
}
else
{
it.reset() ;
}
break ;
}
}
trace( "timeline : " + it.currentFrame + " | " + it.totalFrames + " | frame label : " + it.currentLabel ) ;
}
stage.addEventListener( KeyboardEvent.KEY_DOWN , keyDown ) ;
| Property | Defined by | ||
|---|---|---|---|
| currentFrame : int [read-only]
(read-only) The current frame of the iterator.
| TimelineIterator | ||
| currentLabel : String [read-only]
(read-only) The current label in which the playhead is located in the timeline of the MovieClip instance.
| TimelineIterator | ||
| target : MovieClip [read-only]
(read-only) Returns the target reference of this iterator.
| TimelineIterator | ||
| totalFrames : Number [read-only]
(read-only) The current frame of the iterator.
| TimelineIterator | ||
| Method | Defined by | ||
|---|---|---|---|
|
TimelineIterator(target:MovieClip, framePosition:Number, stepSize:uint = 1)
Creates a new TimelineIterator instance.
| TimelineIterator | ||
![]() |
Returns the internal
ILogger reference of this ILogable object. | CoreObject | |
|
getStepSize():Number
Returns the step size of this PageByPageIterator.
| TimelineIterator | ||
![]() |
hashCode():uint
Returns a hashcode value for the object.
| CoreObject | |
|
hasNext():Boolean
Returns
true if the iteration has more elements. | TimelineIterator | ||
|
hasPrevious():Boolean
Checks to see if there is a previous element that can be iterated to.
| TimelineIterator | ||
|
key():*
Returns the current page number.
| TimelineIterator | ||
|
last():void
Seek the key pointer of the iterator over the last frame of the timeline.
| TimelineIterator | ||
|
next():*
Returns the next Array page of elements or the next element in the Array if the getStepSize() value is 1.
| TimelineIterator | ||
|
previous():*
Returns the previous Array page of elements or the previous element in the Array if the getStepSize() value is 1.
| TimelineIterator | ||
|
remove():*
Unsupported operation in this iterator.
| TimelineIterator | ||
|
reset():void
Resets the key pointer of the iterator.
| TimelineIterator | ||
|
seek(position:*):void
Seek the key pointer of the iterator.
| TimelineIterator | ||
![]() |
Sets the internal
ILogger reference of this ILogable object. | CoreObject | |
![]() |
toSource(indent:int = 0):String
Returns the string representation the source code of the object.
| CoreObject | |
![]() |
toString():String
Returns the string representation of this instance.
| CoreObject | |
| Constant | Defined by | ||
|---|---|---|---|
| DEFAULT_STEP : Number = 1 [static]
The default step value in all the PageByPageIterators.
| TimelineIterator | ||
| currentFrame | property |
currentFrame:int [read-only](read-only) The current frame of the iterator.
Implementation public function get currentFrame():int
| currentLabel | property |
currentLabel:String [read-only](read-only) The current label in which the playhead is located in the timeline of the MovieClip instance.
Implementation public function get currentLabel():String
| target | property |
target:MovieClip [read-only](read-only) Returns the target reference of this iterator.
Implementation public function get target():MovieClip
| totalFrames | property |
totalFrames:Number [read-only](read-only) The current frame of the iterator.
Implementation public function get totalFrames():Number
| TimelineIterator | () | constructor |
public function TimelineIterator(target:MovieClip, framePosition:Number, stepSize:uint = 1)Creates a new TimelineIterator instance.
Parameterstarget:MovieClip — The MovieClip reference of this iterator.
|
|
framePosition:Number — the default framePosition of the specified MovieClip target (default frame 1).
|
|
stepSize:uint (default = 1) — (optional) the step between two frames returns by the iterator (default 1).
|
— if the target argument of this constructor is empty.
|
| getStepSize | () | method |
public function getStepSize():NumberReturns the step size of this PageByPageIterator.
ReturnsNumber — the step size of this PageByPageIterator.
|
| hasNext | () | method |
public function hasNext():Boolean
Returns true if the iteration has more elements.
Boolean — true if the iterator has more elements.
|
| hasPrevious | () | method |
public function hasPrevious():BooleanChecks to see if there is a previous element that can be iterated to.
ReturnsBoolean — true if the iterator has more elements.
|
| key | () | method |
public function key():*Returns the current page number.
Returns* — the current page number.
|
| last | () | method |
public function last():voidSeek the key pointer of the iterator over the last frame of the timeline.
| next | () | method |
public function next():*Returns the next Array page of elements or the next element in the Array if the getStepSize() value is 1.
Returns* — the next Array page of elements or the next element in the Array if the getStepSize() value is 1.
|
| previous | () | method |
public function previous():*Returns the previous Array page of elements or the previous element in the Array if the getStepSize() value is 1.
Returns* — the previous element from the collection.
|
| remove | () | method |
public function remove():*Unsupported operation in this iterator.
Returns* |
— the method remove() in this iterator is unsupported.
|
| reset | () | method |
public function reset():voidResets the key pointer of the iterator.
| seek | () | method |
public function seek(position:*):voidSeek the key pointer of the iterator.
Parametersposition:* |
| DEFAULT_STEP | constant |
public static const DEFAULT_STEP:Number = 1The default step value in all the PageByPageIterators.