The Path control is a windowless Microsoft® DirectAnimation control that animates the position of other controls along a defined vector or spline shape-based path.
PARAM Tag Syntax
<OBJECT ID=object CLASSID="CLSID:D7A7D7C3-D47F-11d0-89D3-00A0C90833E6"> [<PARAM NAME="property" VALUE="setting">] </OBJECT>
Parameters
object | String identifying the object. |
property | One of the properties in the following table. |
setting | Value for the property. |
Property | Description |
AutoStart | Determines whether the path starts playback upon loading. |
Bounce | Sets the path behavior to either reverse direction and return to the beginning, or stop at the end of its playback. |
Direction | Sets the direction of the path playback. |
Duration | Sets the duration of the path playback. |
Library | Retrieves the DirectAnimation Library reference. |
PlayState | Retrieves the path's current playback state. |
Relative | Determines whether the Path control starts playing from its current position or from the absolute position in the target object's coordinate space. |
Repeat | Sets the number of times the path loops during playback. |
Target | Sets the object that is to follow the path. |
Time | Retrieves the elapsed playback time from the start of the path. |
TimerInterval | Sets or retrieves the length of time, in seconds.milliseconds, between the path update. |
Method | Description |
AddTimeMarker | Sets a marker to fire an event when playback reaches the marker position. |
Oval | Specifies an oval structured graphics primitive to be used as the path, with starting point at top center (12 o'clock) |
KeyFrame | Specifies points along the path, in x, y coordinates, and a designated time to reach each point. |
Pause | Stops playback and maintains current elapsed time. |
Play | Begins playback from the current elapsed time. |
Polygon | Specifies a closed series of line segments to use as the path. |
PolyLine | Specifies an open set of line segments to use as the path. |
Rect | Specifies a rectangular structured graphics primitive to use as the path, with starting point at top left. |
Seek | Resets the current playback position to a new, specified position. |
Spline | Specifies a spline to be used as the path. |
Stop | Stops playback at current elapsed time and returns path to the beginning. |
Event | Description |
OnMarker | Occurs when a time marker has been reached, either during path playback or when stopped. |
OnPause | Occurs when path playback is paused. |
OnPlay | Occurs when path playback is played. |
OnPlayMarker | Occurs when a time marker is reached during path playback. |
OnSeek | Occurs when a seek call has been completed. |
OnStop | Occurs when path playback is stopped. |
Determines whether the path starts playback immediately after loading. Read/write at run time; write access is available at run time only when the path is stopped.
PARAM Tag Syntax
<PARAM NAME="AutoStart" VALUE= 0 | -1>
Script Syntax
object.AutoStart=[fStart]
Sets the path to either stop at the end of the path or reverse direction and continue playback. Read/write at run time; write access is available at run time only when the path is stopped.
PARAM Tag Syntax
<PARAM NAME="Bounce" VALUE=0 | -1>
Script Syntax
object.Bounce=[fBounce]
Sets the direction of the path playback, either forward or reverse. Read/write at run time; write access is available at run time only when the path is stopped.
PARAM Tag Syntax
<PARAM NAME="Direction" VALUE= 0 | 1>
Script Syntax
object.Direction = fDirection
Sets the duration of the path playback. Read/write at run time; write access is available at run time only when the path is stopped.
PARAM Tag Syntax
<PARAM NAME=" Duration" VALUE=" time ">
Script Syntax
object.Duration = [ time ]
The Duration property does not take Bounce behavior into account. If the path is set to bounce, the Duration property sets the start to end playback, not the subsequent reversal of direction and return to the start of the path.
Retrieves the reference to the DirectAnimation Library functions.
Script Syntax
IDALibrary = object.Library
Retrieves the path's playback state: stopped, playing, or paused. Read-only at run time.
Script Syntax
state = object.Playstate
Determines whether the Path control starts playing from its current position or from the absolute position in the target object's coordinate space. Read/write at run time; write access is available at run time only when the path is stopped.
PARAM Tag Syntax
<PARAM NAME= Relative VALUE= 0 | -1>
Script Syntax
object.Relative = fPos
The Relative property means with respect to the target object's position, as designated by the STYLE="POSITION: ABSOLUTE | RELATIVE" attribute.
Relative Method example
Right click inside the frame and select View Source to see the HTML code for this example.
Sets the number of times the path loops playback. Read/write at run time; write access is available at run time only when the path is stopped.
PARAM Tag Syntax
<PARAM NAME=" Repeat " VALUE= nRepeat >
Script Syntax
object.Repeat = [ nRepeat ]
Sets the object to follow the Path. Read/write at run time; write access is available at run time only when the path is stopped.
PARAM Tag Syntax
<PARAM NAME=" Target" VALUE=" objTarget ">
Script Syntax
object.Target = [ objTarget ]
The target object must have Top and Left properties. These can be set from script, or in the target object's STYLE attribute.
Target Method example
Right click inside the frame and select View Source to see the HTML code for this example.
Retrieves the elapsed playback time (in milliseconds) from the start of the path playback. Repeat count is included in returned time calculations. Read-only at run time.
Script Syntax
time = object.Time
The default length of time, in seconds.milliseconds, between the path update. Read/write at run time; write access is available at run time only when the path is stopped.
PARAM Tag Syntax
<PARAM NAME="TimerInterval" VALUE="nInterval">
Script Syntax
object.TimerInterval = nInterval
Adds marker at specified playback position, allowing author to generate an event when that playback position is reached. This method can be used or modified only when the path is stopped.
PARAM Tag Syntax
<PARAM NAME=" AddTimeMarkerX" VALUE=" time,
markername ,
[ 0 | -1 ]">
Script Syntax
object.AddTimeMarker (
time,
"markername",
[fAbsolute] )
The OnMarker event occurs whenever the path is at the specified marker, whether or not the path is playing. The OnPlayMarker event only occurs when the path is playing.
This example sets three time markers named Foo, FrameFour, and FrameZero at 0.0, 4.7, and 8.0 respectively. Foo and FrameZero are set to occur every time the path reaches that time marker, and FrameFour is set to occur only the first time the path reaches that time marker during uninterrupted playback.
<PARAM name="AddTimeMarker1" value="0.0, Foo, 0"> <PARAM name="AddTimeMarker2" value="4.7, FrameFour, -1"> <PARAM name="AddTimeMarker3" value="8.0, FrameZero, 0">
AddFrameMarker Method example
Right click inside the frame and select View Source to see the HTML code for this example.
Specifies x and y coordinates along the path and a time to reach each point. The first point defines the starting point of the path. This method can be used or modified only when the path is stopped.
PARAM Tag Syntax
<PARAM NAME=" KeyFrame" VALUE=" npoints,
[ x1,
y1 ,
...,
xN,
yN ],
[ time2,
...,
timeN ]">
Script Syntax
KeyFrameArray = Array(
x1,
y,
...,
xN,
yN )
TimeFrameArray = Array(
time2 ,
...,
timeN )
object.KeyFrame(
npoints,
KeyFrameArray ,
TimeFrameArray )
The Duration property is ignored when this method is invoked.
KeyFrame Method example
Right click inside the frame and select View Source to see the HTML code for this example.
Specifies an oval path, with its starting point at the top center point of the oval (12 o'clock position). This method can be used or modified only when the path is stopped.
PARAM Tag Syntax
<PARAM NAME="Shape" VALUE=" Oval(
xpos,
ypos,
width,
height
) ">
Script Syntax
object.Oval(
xpos ,
ypos ,
width ,
height )
Oval Method example
Right click inside the frame and select View Source to see the HTML code for this example.
Pauses Path playback at current elapsed time and maintains current playback position.
VBscript Syntax
object.Pause
JScript Syntax
object.Pause( )
Begins Path playback at current elapsed time.
VBscript Syntax
object.Play
JScript Syntax
object.Play( )
Calls to the Play Method while a path is playing are ignored.
Specifies a set of closed line segments to use as a path. The first point defines the starting point of the path. This method can be used or modified only when the path is stopped.
PARAM Tag Syntax
<PARAM NAME="Shape" VALUE=" Polygon(
npoints,
[ x1,
y1,
...,
xN,
yN ]
) ">
Script Syntax
PolygonArray = Array(
x1,
y1,
...,
xN,
yN )
object.Polygon(
npoints,
PolygonArray )
The array of x, y coordinates can be specified either as an array, or as comma delimited string of numbers that will be passed into the coordinates.
Polygon Method example
Right click inside the frame and select View Source to see the HTML code for this example.
Specifies a set of line segments to use as a path. The first point defines the starting point of the path. This method can be used or modified only when the path is stopped.
PARAM Tag Syntax
<PARAM NAME="Shape" VALUE=" PolyLine (
npoints,
[ x1,
y1,
...,
xN,
yN ]
) ">
Script Syntax
PolyLineArray = Array(
x1,
y1,
...,
xN,
yN )
object.PolyLine (
npoints,
PolyLineArray
)
Polyline Method example
Right click inside the frame and select View Source to see the HTML code for this example.
Specifies a rectangular path, with its starting point at the top left point of the rectangle. This method can be used or modified only when the path is stopped.
PARAM Tag Syntax
<PARAM NAME="Shape" VALUE="Rect(
xpos,
ypos,
width,
height ) ">
Script Syntax
object.Rect (
xpos ,
ypos ,
width ,
height )
Rect Method example
Right click inside the frame and select View Source to see the HTML code for this example.
Seeks to another position in the Path playback.
Script Syntax
object.Seek (
time )
Specifies a vector spline to be used as a path. The first point defines the starting point of the path. This method can be used or modified only when the path is stopped.
PARAM Tag Syntax
<PARAM NAME="Shape" VALUE=" Spline(
npoints,
[ x1,
y1,
x2,
y2... ]
) ">
Script Syntax
object.Spline (
npoints,
[ x1,
y1,
x2,
y2... ] )
You need to specify 4 points for each curve in the spline. The array of x,y coordinates can be specified either as an array or as a comma delimited string of number that will be passed as the coordinate set. The number of points in the spline and their spacing can have an effect upon the speed of the path. Having too many points too close together along the path can cause the path to seem as if it is slowing down when it traverses those points.
Spline Method example
Right click inside the frame and select View Source to see the HTML code for this example.
Stops playback of the path at the current position and rewinds the path to its beginning.
VBscript Syntax
object.Stop
JScript Syntax
object.Stop( )
Occurs when a time marker has been reached.
VBScript Syntax
Sub object _ onmarker (
markername )
script
End Sub
JScript Syntax
<SCRIPT LANGUAGE="JavaScript" FOR= object EVENT= onmarker (
markername ) >
script
<SCRIPT>
This event occurs whenever playback reaches the marker point, either when the path is playing or stopped. For example, if you seek to the marker position while the path is paused or stopped, the OnMarker event will occur.
Occurs when path playback is paused.
VBScript Syntax
Sub object _ onpause ( )
script
End Sub
JScript Syntax
<SCRIPT LANGUAGE="JavaScript" FOR= object EVENT= onpause >
script
<SCRIPT>
Occurs when path playback starts.
VBScript Syntax
Sub object _ onplay ( )
script
End Sub
JScript Syntax
<SCRIPT LANGUAGE="JavaScript" FOR= object EVENT= onplay >
script
<SCRIPT>
Occurs when a marker is reached during path playback.
VBScript Syntax
Sub object _ onplaymarker (
markername )
script
End Sub
JScript Syntax
<SCRIPT LANGUAGE="JavaScript" FOR= object EVENT= onplaymarker (
markername ) >
script
<SCRIPT>
Occurs after a Seek call has been completed.
VBScript Syntax
Sub object _ onseek (
newtime )
script
End Sub
JScript Syntax
<SCRIPT LANGUAGE="JavaScript" FOR= object EVENT= onseek (
newtime ) >
script
<SCRIPT>
Occurs when the path stops playing.
VBScript Syntax
Sub object _ onstop ( )
script
End Sub
JScript Syntax
<SCRIPT LANGUAGE="JavaScript" FOR= object EVENT= onstop >
script
<SCRIPT>
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.