Frame Property

Sprite Control

Specifies the sprite image for the frame currently displayed on the page. Read-only at run time.

Syntax

ScriptingnFrame=spriteObj.Frame

Possible Values

nFrame
Integer expression identifying the current frame, from 0 to n, where n represents the last frame in the sprite source. The default value is 1.

Remarks

If the sprite has a frame map, the value of the Frame property is a one-based index into the frame map. For example, if the frame map defines 10 frames, the Frame property value is 10 when the last frame in the frame map appears on the page.

VBScript note: To use the value returned by the Frame property, you will have to use the Microsoft® Visual Basic®, Scripting Edition cInt function to convert the value from an unsigned integer into a variant that VBScript will accept. An example would be FrameNum=cInt(sprite.Frame).

Example

The following example sets the indicator for a form to the value of the current frame for the sprite named SpriteHorse.

document.MyForm.txtFrame.value=SpriteHorse.Frame

Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.