From 2527c804ea5be454f2749272f050829c67d01cc8 Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Mon, 19 Mar 2018 16:44:49 -0400 Subject: [PATCH] =?UTF-8?q?Clones=20get=20ref=20to=20parent=E2=80=99s=20ac?= =?UTF-8?q?tiveSoundPlayers=20obj?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sprites/rendered-target.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/sprites/rendered-target.js b/src/sprites/rendered-target.js index 8da2d2b5a..03db26f12 100644 --- a/src/sprites/rendered-target.js +++ b/src/sprites/rendered-target.js @@ -146,6 +146,13 @@ class RenderedTarget extends Target { this.audioPlayer = null; if (this.runtime && this.runtime.audioEngine) { this.audioPlayer = this.runtime.audioEngine.createPlayer(); + // If this is a clone, it gets a reference to its parent's activeSoundPlayers object. + if (!this.isOriginal) { + const parent = this.sprite.clones[0]; + if (parent && parent.audioPlayer) { + this.audioPlayer.activeSoundPlayers = parent.audioPlayer.activeSoundPlayers; + } + } } }