diff --git a/src/gameobjects/components/Depth.js b/src/gameobjects/components/Depth.js index 7240dd2dd..0f5bafda3 100644 --- a/src/gameobjects/components/Depth.js +++ b/src/gameobjects/components/Depth.js @@ -97,7 +97,7 @@ var Depth = { */ bringMeToTop: function() { - var list = (this.parentContainer) ? gameObject.parentContainer : this.displayList.list; + var list = (this.parentContainer) ? this.parentContainer.list : this.displayList.list; if (!list) { @@ -118,7 +118,7 @@ var Depth = { */ sendMeToBack: function() { - var list = (this.parentContainer) ? gameObject.parentContainer : this.displayList.list; + var list = (this.parentContainer) ? this.parentContainer.list : this.displayList.list; if (!list) { @@ -142,7 +142,7 @@ var Depth = { */ moveMyDepthBelow: function(gameObject) { - var list = (this.parentContainer) ? gameObject.parentContainer : this.displayList.list; + var list = (this.parentContainer) ? this.parentContainer.list : this.displayList.list; if (!list) { @@ -166,7 +166,7 @@ var Depth = { */ moveMyDepthAbove: function(gameObject) { - var list = (this.parentContainer) ? gameObject.parentContainer : this.displayList.list; + var list = (this.parentContainer) ? this.parentContainer.list : this.displayList.list; if (!list) {