activeTime property
Gets the current point in time along the total active timeline, including repeats and time spent in reverse mode.
Syntax
JScript |
---|
|
Property values
Type: Integer
the current point in time along the timeline, in seconds. The value of this property ranges from 0 to activeDur.
Remarks
This property supersedes the currTime property.
The activeTime property contains the time that has elapsed since the timeline for the object began, including time spent repeating and in reverse mode. Run the following example to see how activeTime accumulates throughout the duration of the timeline.
Examples
This example shows how activeTime, segmentTime, and simpleTime relate to each other.
Code example: http://samples.msdn.microsoft.com/workshop/samples/author/behaviors/htmltime/animations/timelines.htm
<HTML XMLNS:t ="urn:schemas-microsoft-com:time">
<HEAD>
<TITLE>autoReverse Example</TITLE>
<STYLE>
.time{behavior: url(#default#time2);}
</STYLE>
<?IMPORT namespace="t" implementation="#default#time2">
<SCRIPT LANGUAGE="JScript">
window.onload = fnOnLoad;
function fnOnLoad()
{
// Set up a timer to watch the time values.
window.setInterval(fnUpdateTimes, 100);
}
function fnUpdateTimes()
{
oSimpleTime.innerHTML = " simpleTime: " +
(oAnim.currTimeState.simpleTime);
oSegmentTime.innerHTML = "segmentTime: " +
(oAnim.currTimeState.segmentTime);
oActiveTime.innerHTML = " activeTime: " +
(oAnim.currTimeState.activeTime);
}
function fnRepeat()
{
oRepeatCount.innerHTML = "repeatCount: " +
(oAnim.currTimeState.repeatCount + 1);
// Add one because repeatCount is zero-based.
}
</SCRIPT>
</HEAD>
<BODY>
<DIV STYLE="font-family:courier;">
<DIV ID="oRepeatCount">repeatCount: 1</DIV>
<DIV ID="oSimpleTime"> simpleTime: 0</DIV>
<DIV ID="oSegmentTime">segmentTime: 0</DIV>
<DIV ID="oActiveTime"> activeTime: 0</DIV>
</DIV>
<DIV ID="oDiv" CLASS="time" STYLE="position:absolute; left:50px;
top:250px; width:100px; height:100px; background-color:blue;"></DIV>
<t:ANIMATEMOTION ID="oAnim" targetElement="oDIV" to="340,40" dur="2"
autoReverse="true" repeatCount="5" onrepeat="fnRepeat()" fill="freeze"/>
</BODY>
</HTML>
See also
Reference
Conceptual