activeTimeToParentTime method

Converts a value in the element's active timeline to the corresponding point in the parent timeline.

Syntax

*object.*activeTimeToParentTime(activeTime)

Parameters

  • activeTime [in]
    Type: double

    An Integer that specifies a point on the element's active timeline. Legal values range from 0 to activeDur.

Return value

Type: Integer

An Integer that specifies the point in the parent timeline that corresponds to activeTime.

Examples

This example uses the activeTimeToParentTime method to compare the value of the element's active timeline to the corresponding point in the parent timeline. To see each element's point in the parent timeline, click the element's activeTimeToParentTime button.

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/behaviors/activeTimeToParentTime.htm

<HTML XMLNS:t="urn:schemas-microsoft-com:time">
<HEAD>
<TITLE>activeTimeToParentTime Method</TITLE>
<?IMPORT namespace="t" implementation="#default#time2">

<STYLE>
    .time{behavior: url(#default#time2);}
</STYLE>
</HEAD>

<BODY ID="b1" TOPMARGIN=0 LEFTMARGIN=0 BGPROPERTIES="FIXED" BGCOLOR="#FFFFFF"
    LINK="#000000" VLINK="#808080" ALINK="#000000">

<B>Time container timer:</B>
<SPAN class="time" dur="1" repeatCount="indefinite"
    onrepeat="innerText=parseInt(t1.currTimeState.activeTime);">0</SPAN>

<BR>
<t:excl id="t1" class="time" dur="10s" autoReverse="true">
    <DIV id="div1" style="color:blue" class="time" begin="1s" dur="3s" 
        timeAction="visibility">First Line</DIV>
    <DIV id="div2" style="color:green" class="time" begin="4s" dur="3s"
        timeAction="visibility">Second Line</DIV>
    <DIV id="div3" style="color:red" class="time" begin="7s" dur="3s"
        timeAction="visibility">Third Line</DIV>
</t:excl>

<BR>
<BUTTON class="time" dur="1" repeatCount="indefinite"
    onclick="alert('Point in parent timeline: ' + 
        div1.activeTimeToParentTime(t1.currTimeState.activeTime));"
    onrepeat="innerText='First line\'s activeTimeToParentTime at ' + 
        parseInt(t1.currTimeState.activeTime) + ' seconds';">
    First line's activeTimeToParentTime at 0 seconds
</BUTTON>

<BR>
<BUTTON class="time" dur="1" repeatCount="indefinite" 
    onclick="alert('Point in parent timeline: ' +
        div2.activeTimeToParentTime(t1.currTimeState.activeTime));" 
    onrepeat="innerText='Second line\'s activeTimeToParentTime at ' +
        parseInt(t1.currTimeState.activeTime) + ' seconds';">
    Second line's activeTimeToParentTime at 0 seconds
</BUTTON>

<BR>
<BUTTON class="time" dur="1" repeatCount="indefinite"
    onclick="alert('Point in parent timeline: ' +
        div3.activeTimeToParentTime(t1.currTimeState.activeTime));"
    onrepeat="innerText='Third line\'s activeTimeToParentTime at ' +
        parseInt(t1.currTimeState.activeTime) + ' seconds';">
    Third line's activeTimeToParentTime at 0 seconds
</BUTTON>

</BODY>
</HTML>

See also

transitionFilter

animate

animateColor

animateMotion

animation

audio

excl

img

media

par

ref

seq

set

time2

video

Reference

activeTime

parentTimeBegin

parentTimeEnd

Conceptual

Introduction to HTML+TIME