• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Sound Object

Sound Object

Method Description Parameters
new Sound (target ) Creates a new Sound object. target , the target path for a movie clip
attachSound(idName ) Attaches a sound file from the Library to a Sound object. idName , the identifier of your sound in the Library’s Linkage property
getBytesLoaded() Returns the number of bytes (data) loaded for the Sound object. 
getBytesTotal() Returns the total number of bytes (data) for the Sound object. 
getPan() Returns the pan level assigned by setPan(). getTransform() Returns the sound- transformation information assigned by setTransform(). 
getVolume() Returns the volume level assigned by setVolume(). 
loadSound (url, isStreaming ) Loads an MP3 file url , the path to the MP3 file isStreaming , determines if the sound is streaming or not, true or false
setPan(pan ) Sets the left–right balance of the sound. pan , a number from –100 (left) to 100 (right)
setTransform(sxform ) Sets how the left and right sounds are distributed through the left and right speakers. sxform , an object holding the sound-transformation parameters ll, lr, rr, and rl
setVolume(volume ) Sets the percentage of the volume level. volume , a number from 0 (silent) to 100 (normal)
start(secondsOffset , loops ) Plays the attached sound. secondsOffset , the starting point of the sound (in seconds) loops , the number of times the sound loops
stop() Stops the attached sound. 
Property Description 
duration Duration of sound in milliseconds 
position Number of milliseconds sound has been playing 



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint