Sound.onMarkerComplete event is now dispatched when a marker stops. See Sound.onLoop for a looping marker event (thanks registered99, fixes #500)

This commit is contained in:
photonstorm 2014-03-02 11:11:20 +00:00
parent 66bdf56349
commit 52118be088
2 changed files with 8 additions and 1 deletions

View file

@ -194,6 +194,7 @@ Bug Fixes:
* Loader.replaceInFileList wouldn't over-write the previous entry correctly, which caused the Loader.image overwrite parameter to fail (thanks basoko, fixes #493)
* If the game was set to NO_SCALE and you swapped orientation, it would pause and resize, then fail to resize when you swapped back (thanks starnut, fixes #258)
* Device no longer things a Windows Phone or Windows Tablet are desktop devices (thanks wombatbuddy, fixes #506)
* Sound.onMarkerComplete event is now dispatched when a marker stops. See Sound.onLoop for a looping marker event (thanks registered99, fixes #500)
TO DO:

View file

@ -341,7 +341,7 @@ Phaser.Sound.prototype = {
if (this.currentTime >= this.durationMS)
{
console.log(this.currentMarker, 'has hit duration');
// console.log(this.currentMarker, 'has hit duration');
if (this.usingWebAudio)
{
if (this.loop)
@ -359,6 +359,7 @@ Phaser.Sound.prototype = {
else
{
// console.log('loop3');
this.onMarkerComplete.dispatch(this.currentMarker, this);
this.play(this.currentMarker, 0, this.volume, true, true);
}
}
@ -709,6 +710,11 @@ Phaser.Sound.prototype = {
this.isPlaying = false;
var prevMarker = this.currentMarker;
if (this.currentMarker !== '')
{
this.onMarkerComplete.dispatch(this.currentMarker, this);
}
this.currentMarker = '';
this.onStop.dispatch(this, prevMarker);