Lingo Dictionary > D-F > fadeTo() |  |

fadeTo()

Syntax

    sound(channelNum).fadeTo(volume {, milliseconds })
    fadeTo(sound(channelNum), volume {, milliseconds })

Description

This function gradually changes the `volume` of sound channel `channelNum` to the specified volume over the given number of milliseconds, or 1000 milliseconds (1 second) if no value is given. The range of values for volume is 0-255.

The current pan setting is retained for the the entire fade.

To see an example of `fadeTo()` used in a completed movie, see the Sound Control movie in the Learning\Lingo Examples folder inside the Director application folder.

Example

This statement changes the volume of sound channel 4 to 150 over a period of 2 seconds. It can be a fade up or a fade down, depending on the original volume of sound channel 4 when the fade begins.

    sound(4).fadeTo(150, 2000)

See also

`fadeIn()`, `fadeOut()`, `pan (sound property)`, `volume (sound channel)`