Lingo Dictionary > O-R > preLoadTime

 

preLoadTime

Syntax

member(whichSWACastMember).preLoadTime
sound(channelNum).queue([#member: member(whichmember), {#startTime: milliseconds, #endTime: milliseconds, #loopStartTime: milliseconds, #loopEndTime: milliseconds, #loopCount: numberOfLoops, #preloadTime: milliseconds, #rateShift: shiftAmount}])
sound(channelNum).preLoadTime

Description

Sound property; for Shockwave Audio cast members, specifies the amount of the Shockwave Audio (SWA) streaming cast member to download, in seconds, before playback begins or when a preLoadBuffer() command is used. The default value is 5 seconds.

This property can be set only when the SWA streaming cast member is stopped.

For sound channels, the value is given in milliseconds. The default value is 1500 milliseconds. The preloadTime of a sound member playing in one of the sound channels may only be set with a queue(), play(), or setPlayList() command. When tested, the value is for the currently playing sound in the specified channel's queue.

Example

This handler sets the preload download time for the SWA streaming cast member Louis Armstrong to 6 seconds. The actual preload occurs when a preLoadBuffer() or play command is issued.

on mouseDown
	member("Louis Armstrong").stop()
	member("Louis Armstrong").preLoadTime = 6
end

Example

This handler queues and plays two sounds. The first sound, cast member Chimes, is played in its entirety. The second sound, cast member introMusic, is played starting at its 3-second point, with a loop repeated 5 times from the 8-second point to the 8.9 second point, and stopping at the 10-second point. 4 seconds of the sound will be preloaded and it will be played back with a rateShift of 1, or at one whole step higher pitch than normal.

on playMusic
	sound(2).queue([#member: member("Chimes")])
	sound(2).queue([#member: member("introMusic"), #startTime: 3000,\
	#endTime: 10000, #loopStartTime: 8000, #loopEndTime: 8900, #loopCount: 5, \
	#preloadTime: 4000, #rateShift: 1])
	sound(2).play()
end

See also

preLoadBuffer(), queue(), setPlaylist(), getPlaylist(), play() (sound), stop() (sound)