Difference between revisions of "SoundChannel Event.COMPLETE"

From GiderosMobile
(Created page with "'''<translate>Available since</translate>:''' Gideros 2011.6<br/> '''<translate>Value</translate>:''' complete<br/> '''<translate>Defined by</translate>:''' Special:MyLangua...")
 
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Value</translate>:''' complete<br/>
+
'''Value:''' complete<br/>
'''<translate>Defined by</translate>:''' [[Special:MyLanguage/SoundChannel|SoundChannel]]<br/>
+
'''Defined by:''' [[SoundChannel]]<br/>
  
 
=== Description ===
 
=== Description ===
 
This event is dispatched when the sound channel has finished playing.
 
This event is dispatched when the sound channel has finished playing.
 +
 +
=== Example ===
 +
<syntaxhighlight lang="lua">
 +
-- load a music file
 +
local snd = Sound.new("DST-Psykick.mp3")
 +
-- start playing the music file and store the channel
 +
local chan = snd:play()
 +
-- define the Event.COMPLETE function that is called when the sound
 +
-- finishes playing
 +
function onSoundComplete(event)
 +
print ("Sound complete")
 +
end
 +
-- add the event listener that is firing when the sound finishes playing
 +
chan:addEventListener(Event.COMPLETE,onSoundComplete)
 +
</syntaxhighlight>
  
 
{{SoundChannel}}
 
{{SoundChannel}}

Latest revision as of 15:33, 13 July 2023

Available since: Gideros 2011.6
Value: complete
Defined by: SoundChannel

Description

This event is dispatched when the sound channel has finished playing.

Example

-- load a music file
local snd = Sound.new("DST-Psykick.mp3")
-- start playing the music file and store the channel
local chan = snd:play()
-- define the Event.COMPLETE function that is called when the sound
-- finishes playing
function onSoundComplete(event)
	print ("Sound complete")
end
-- add the event listener that is firing when the sound finishes playing
chan:addEventListener(Event.COMPLETE,onSoundComplete)