@@ -126,7 +126,7 @@ var Container = new Class({
126126 * @private
127127 * @since 3.4.0
128128 */
129- this . addCallback = this . addHandler ;
129+ this . addCallback = this . addHandler . bind ( this ) ;
130130
131131 /**
132132 * A callback that is invoked every time a child is removed from this list.
@@ -136,7 +136,7 @@ var Container = new Class({
136136 * @private
137137 * @since 3.4.0
138138 */
139- this . removeCallback = this . removeHandler ;
139+ this . removeCallback = this . removeHandler . bind ( this ) ;
140140
141141 /**
142142 * A reference to the Scene Display List.
@@ -151,9 +151,9 @@ var Container = new Class({
151151 this . setPosition ( x , y ) ;
152152 this . clearAlpha ( ) ;
153153
154- if ( Array . isArray ( children ) )
154+ if ( children )
155155 {
156- this . addMultiple ( children ) ;
156+ this . add ( children ) ;
157157 }
158158 } ,
159159
@@ -196,7 +196,7 @@ var Container = new Class({
196196 * @param {Phaser.GameObjects.Container } list - The List the Game Object was added to (also this Container)
197197 * @param {Phaser.GameObjects.GameObject } gameObject - The Game Object that was just added to this Container.
198198 */
199- addHandler : function ( list , gameObject )
199+ addHandler : function ( gameObject )
200200 {
201201 gameObject . on ( 'destroy' , this . remove , this ) ;
202202
@@ -209,7 +209,7 @@ var Container = new Class({
209209 gameObject . parentContainer . remove ( gameObject ) ;
210210 }
211211
212- gameObject . parentContainer = list ;
212+ gameObject . parentContainer = this ;
213213 }
214214 } ,
215215
@@ -223,9 +223,9 @@ var Container = new Class({
223223 * @param {Phaser.GameObjects.Container } list - The List the Game Object was removed from (also this Container)
224224 * @param {Phaser.GameObjects.GameObject } gameObject - The Game Object that was just removed from this Container.
225225 */
226- removeHandler : function ( list , gameObject )
226+ removeHandler : function ( gameObject )
227227 {
228- gameObject . off ( 'destroy' , list . remove , this ) ;
228+ gameObject . off ( 'destroy' , this . remove , this ) ;
229229
230230 if ( this . exclusive )
231231 {
0 commit comments