onStopAll function for stop button

This commit is contained in:
Eric Rosenbaum 2016-10-27 16:28:39 -04:00
parent 1e5555e96d
commit 6dadaba117
2 changed files with 16 additions and 0 deletions
src
engine
sprites

View file

@ -429,6 +429,7 @@ Runtime.prototype.stopAll = function () {
// Dispose all clones.
var newTargets = [];
for (var i = 0; i < this.targets.length; i++) {
this.targets[i].onStopAll();
if (this.targets[i].hasOwnProperty('isOriginal') &&
!this.targets[i].isOriginal) {
this.targets[i].dispose();

View file

@ -435,6 +435,21 @@ Clone.prototype.makeClone = function () {
*/
Clone.prototype.onGreenFlag = function () {
this.clearEffects();
if (this.audioEngine) {
this.audioEngine.stopAllSounds();
this.audioEngine.clearEffects();
}
};
/**
* Called when the project receives a "stop all"
* Stop all sounds
*/
Clone.prototype.onStopAll = function () {
if (this.audioEngine) {
this.audioEngine.stopAllSounds();
this.audioEngine.clearEffects();
}
};
/**