Lingo Dictionary
205
duration
Syntax
member(
whichCastMember
)
.
duration
the duration of member
whichCastMember
Description
Cast member property; determines the duration of the specified Shockwave Audio (SWA),
transition, and QuickTime cast members.
•
When
whichCastMember
is a streaming sound file, this property indicates the duration of the
sound. The
duration
property returns 0 until streaming begins. Setting
preLoadTime
to 1
second allows the bit rate to return the actual duration.
•
When
whichCastMember
is a digital video cast member, this property indicates the digital
video’s duration. The value is in ticks.
•
When
whichCastMember
is a transition cast member, this property indicates the transition’s
duration. The value for the transition is in milliseconds. During playback, this setting has the
same effect as the Duration setting in the Frame Transition dialog box.
This property can be tested for all cast members that support it, but only set for transitions.
To see an example of
duration
used in a completed movie, see the QT and Flash movie in the
Learning/Lingo Examples folder inside the Director application folder.
Examples
If the SWA cast member Louie Prima has been preloaded, this statement displays the sound’s
duration in the field cast member Duration Displayer:
on exitFrame
if member("Louie Prima").state = 2 then
member("Duration Displayer").text = member("Louie Prima").duration
end if
end
You can use a behavior on a digital video sprite to loop the playhead in the current frame until the
movie is finished playing, allowing it to continue when the end is reached:
property spriteNum
on exitFrame me
myMember = sprite(spriteNum).member
myDuration = member(myMember).duration
myMovietime = sprite(spriteNum).movieTime
if myDuration > myMovietime then
go to the frame
else
go to the frame + 1
end if
end
Содержание DIRECTOR MX-LINGO DICTIONARY
Страница 1: ...Lingo Dictionary Macromedia Director MX...
Страница 756: ...Index 756...