Properties, Methods, and Events Reference

Properties, Methods, and Events Reference

This section describes the properties, methods, and events associated with the visual and transition filters.
Properties
Duration
Status
enabled

Methods
Apply
Play
Stop
AddAmbient Method (Light Filter Effect)
AddCone Method (Light Filter Effect)
AddPoint Method (Light Filter Effect)
ChangeColor Method (Light Filter Effect)
ChangeStrength Method (Light Filter Effect)
Clear Method (Light Filter Effect)
MoveLight_Method (Light Filter Effect)

Event
Onfilterchange


Duration Property

Description

Sets the default length of time the transition will take to complete.

Syntax

STYLE="FILTER: transitiontype(duration=duration, transition=transitionshape)"

ParameterDescription
duration Length of time the transition should take to complete. Value, float. Value is expressed in seconds.milliseconds (0.000). Read-write at run time. If transition has been applied or is playing, read-only.
transitionshape Shape of the transition (Reveal transition only). Integer. Value from 0 to 23. For information on the available transition shapes, see the Reveal Transition topic.

Remarks

A transition's playback duration can also be set as a parameter of the Play method.

Applies to

Transition filters


enabled

Description

Specifies whether the filter is enable or disabled

Syntax

status = object.filter.enabled=fValue

ParameterDescription
fValue Boolean value indicating whether the filter is enabled (true) or disabled (false). The property is read-write.

Remarks


<img id=image1 src="sample.jpg" style="filter:blur(strength=50) flipv()">

<SCRIPT>
   image1.filters[1].enabled = false; // disable the flip filter
</SCRIPT>

Applies to

Transition filters


Status Property

Description

Returns the current status of the transition.

Syntax

nStatus = object.filter.Status

ParameterDescription
status Integer. Values are 0 (transition stopped), 1 (transition applied), or 2 (transition playing). Read-only.

Applies to

Transition filters


Onfilterchange Event

Description

Fires when a visual filter changes state or completes a transition.

Remarks

This event will bubble. Events that bubble can be handled on any parent element of the object that fired the event.

If you have multiple objects with transitions on a page, you can determine which object fired the Object_onfilterchange event by checking Window.Event.srcElement. The filters and transitions that ship with Internet Explorer 4.0 fire the event when a transition completes, although the underlying architecture allows future filters to fire at any time their internal states change.

<HTML>
<HEAD>
<TITLE>Microsoft Cascading Style Sheets Controls Samples </TITLE>
</HEAD>
<Div ID = "TextRegion"
    STYLE="Position:absolute;LEFT: 0; TOP: 200; WIDTH: 100%; VISIBILITY: visible; FILTER: revealTrans(Transition = 1, Duration = 1.25)">
Some Text
</DIV>
<DIV ID="ImageRegion"
    STYLE="Position:absolute;LEFT: 0; TOP: 200; WIDTH: 100%; VISIBILITY: hidden; FILTER: revealTrans(Transition = 1, Duration = 1.25)">
<IMAGE SRC="Image1.jpg">
</DIV>
<SCRIPT LANGUAGE=VBScript>
Sub Window_onload
    Call TextRegion.filters.revealTrans.Apply ()
    Region.filters.RevealTrans(transition=23)
    Call ImageRegion.filters.revealTrans.Apply()
    Image1.filters.revealTrans(transition=12)
    Call Start
End Sub

Sub Start
    If TextRegion.style.visibility = "visible"   then
        ImageRegion.style.visibility = "hidden"
    Else
        ImageRegion.style.visibility = "visible"
        TextRegion.style.visibility = "hidden"
    End if
    Call TextRegion.Style.filters.revealTrans.Play(1.5)
End Sub

Sub Region_onfilterchange
Select case Window.Event.srcElement
    Case "Region"
        If Region.filters.revealTrans.Status = 0 then
                Call ImageRegion.filters.revealTrans.Play(1.5)
        End If
    End select
End Sub
</SCRIPT>
</BODY>
</HTML>

An asterisk in the following applies to list indicates that a defined height, width, or absolute position is required.

Applies To

BODY, BUTTON, DIV*, IMG, INPUT, MARQUEE, SPAN*, TABLE, TD, TEXTAREA, TFOOT, TH, THEAD, TR


Apply Method

Description

Applies a transition to the designated object.

Syntax

Call object.filters.item(index).apply()

ParameterDescription
object Identifier of the object to which the filter is to be applied.
index Integer. Index (position in the collection of transitions for this object) number of the transition. Value can be 0-n, where n is the last transition made available to this object.

Applies to

Transition filters


Play Method

Description

Plays the transition.

Syntax

Call object.filters.item(index).play(duration)

ParameterDescription
object Identifier of the object to which the filter has been applied.
duration Float, seconds.milliseconds (0.000). Valid values are 0.0-N.n. Optional parameter, read-write at run time.

Remarks

If a playback duration is explicitly specified as a parameter of the this method, it will override the Duration property assigned to the transition for that instance of the transition's playback.

Applies to

Transition filters


Stop Method

Description

Stops transition playback.

Syntax

Call object.filters.item(index).stop()

ParameterDescription
object Identifier of the object to which the filter is attached.
index Index number of the transition whose playback is to be stopped.

Remarks

Fires the Onfilterchange event.

Applies to

Transition filters


AddAmbient Method

Description

Adds an ambient light to the Lights Filter Effect object. Ambient light is nondirectional light that sheds parallel beams perpendicular to the surface of the page. Ambient light has color and strength values and can be used to add more color to the page; it is often used in conjunction with other lights.

Syntax

call object.filters.Light.addAmbient(R,G,B,strength)

ParameterDescription
object Name of the object to which the Light filter is applied.
R Red value, integer from 0 to 255. 0 is lowest saturation, 255 is highest.
G Green value, integer from 0 to 255. 0 is lowest saturation, 255 is highest.
B Blue value, integer from 0 to 255. 0 is lowest saturation, 255 is highest.
strength Intensity setting.

Remarks

This example shows how to create a blue ambient light with a fairly low intensity.

call object.filters.Light.addAmbient(0,0,255,10)

Applies To

Light Filter


AddCone Method

Description

Adds a cone light to the Lights Filter Effect object to cast a directional light on the page.

Syntax

call object.filters.Light.addCone(x1,y1,z1,x2,y2,R,G,B,strength,spread)

ParameterDescription
object Name of the object to which the Light filter is applied.
x1, y1, z1 Source light's coordinates.
x2, y2 Target focus coordinates. Note: z2=0 is implied.
R Red value, integer from 0 to 255. 0 is lowest saturation, 255 is highest.
G Green value, integer from 0 to 255. 0 is lowest saturation, 255 is highest.
B Blue value, integer from 0 to 255. 0 is lowest saturation, 255 is highest.
strength Intensity setting. Integer value. Note: strength specified pertains to the target coordinates. When the light is later moved, the strength is re-scaled to still pertain to the new target.
spread Angle of light spread in the relationship between the vertical position of the light source and the surface of the visual object. 0 to 90 degrees. Low spread (such as low integer values) produces a smaller shaped cone of light. High angle of spread produces an oblique oval or circle of light.

Remarks

The cone light fades with distance from the target x,y position. It displays a hard edge at the near edge of the cone light's focus and fades gradually as it reaches the cone light's distance threshold.

Applies To

Light Filter


AddPoint Method

Description

Adds a point light source, like a light bulb.

Syntax

call object.filters.Light.addPoint(x,y,z,R,G,B,strength)

ParameterDescription
object Name of the object to which the Light filter is applied.
x, y, z Point light's coordinates.
R Red value, integer from 0 to 255. 0 is lowest saturation, 255 is highest.
G Green value, integer from 0 to 255. 0 is lowest saturation, 255 is highest.
B Blue value, integer from 0 to 255. 0 is lowest saturation, 255 is highest.
strength Intensity setting. Integer value.

Remarks

Intensity on the page is controlled by the angle of light on the surface. Add several for great multipoint gradients.

Applies To

Light Filter


ChangeColor Method

Description

Changes the light color for any light on the page.

Syntax

call object.filters.Light.ChangeColor(lightnumber, r,g,b, fAbsolute)

ParameterDescription
object Name of the object to which the Light filter is applied.
lightnumber Identifying number for the light, for use in script.
r Red value, integer from 0 to 255. 0 is lowest saturation, 255 is highest.
g Green value, integer from 0 to 255. 0 is lowest saturation, 255 is highest.
b Blue value, integer from 0 to 255. 0 is lowest saturation, 255 is highest.
fAbsolute If this flag is true (nonzero), ChangeColor sets the value to be that new value. If this flag is false (zero), ChangeColor increments or decrements the color value by that amount.

Applies To

Light Filter


ChangeStrength Method

Description

Changes the intensity of the light.

Syntax

call object.filters.Light.ChangeStrength(lightnumber, strength, fAbsolute)

ParameterDescription
object Name of the object to which the Light filter is applied.
lightnumber Identifying number for the light, for use in script.
strength New intensity.
fAbsolute If this flag is true (nonzero), ChangeStrength sets the strength value to be the new value. If this flag is false (zero), ChangeStrength increments or decrements the strength value by that amount.

Applies To

Light Filter


Clear Method

Description

Deletes all lights associated with the specified Lights Filter.

Syntax

call object.filters.Light.Clear

ParameterDescription
object Name of the object to which the Light filter is applied.

Remarks

This will clear all light sources on the object.

Applies To

Light Filter


MoveLight Method

Description

Moves the light effect on the page.

Syntax

call object.filters.Light.MoveLight(lightnumber, x, y, z, fAbsolute)

ParameterDescription
object Name of the object to which the Light filter is applied.
lightnumber Identifying number for the light, for use in script.
x, y, z Location to move the light to.
fAbsolute Whether the movement is absolute or relative.

Remarks

For cone lights, this method changes the position of the light's focus, the target x,y values. For point lights, this method changes the source location, the source x,y,z values. This method has no effect for ambient lights.

Applies To

Light Filter

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.