User Guide

duration (RealMedia, SWA) 747
Example
If the SWA cast member Louie Prima has been preloaded, this statement displays the sound’s
duration in the field cast member Duration Displayer:
-- Lingo syntax
on exitFrame
if member("Louie Prima").state = 2 then
member("Duration Displayer").text = \
string(member("Louie Prima").duration)
end if
end
// JavaScript syntax
function exitFrame() {
if (member("Louie Prima").state == 2) {
member("Duration Displayer").text =
member("Louie Prima").duration.toString()
}
}
duration (RealMedia, SWA)
Usage
-- Lingo syntax
memberOrSpriteObjRef.duration
// JavaScript syntax
memberOrSpriteObjRef.duration;
Description
RealMedia or Shockwave audio sprite or cast member property; returns the duration of a
RealMedia or Shockwave Audio stream, in milliseconds. The duration of the stream is not known
until the cast member starts to play. If the stream is from a live feed or has not been played, the
value of this property is 0. This property can be tested but not set.
Example
The following examples show that the duration of the RealMedia stream in sprite 2 and the cast
member Real is 100,500 milliseconds (100.500 seconds).
-- Lingo syntax
put(sprite(2).duration) -- 100500
put(member("Real").duration) -- 100500
// JavaScript syntax
put(sprite(2).duration); // 100500
put(member("Real").duration); // 100500
See also
play() (RealMedia, SWA, Windows Media), seek(), currentTime (RealMedia)