Here’s a link to my project :
https://thundros.github.io/menu-system-doosan/
so I have uploaded a new 'ContainerScene.js'
at :
& I am trying to figure out inside of :
https://thundros.github.io/menu-system-doosan/src/Scenes/ContainerScene.js
&
https://thundros.github.io/menu-system-doosan/src/Scenes/OptionsScene.js
I’m trying to fix :
phaser.js:36795 Uncaught TypeError: Cannot read property 'once' of undefined
I’m wondering why it’s not letting me do :
this.__container.create ({
scene : this, x : 100, y : 100,
w : 100, h : 100, useChildIndex : true,
childData : [
this.__myArrowLeft,
this.__myArrowRight,
]
});
Here is the 'create ( )'
function from 'ContainerScene.js'
:
create : function ( __objData ) {
this.__objData = __objData;
this.__childData = this.__objData.childData;
this.__scene = this.__objData.scene;
this.__x = this.__objData.x;
this.__y = this.__objData.y;
this.__w = this.__objData.w;
this.__h = this.__objData.h;
this.__useChildIndex = this.__objData.useChildIndex;
if ( this.__useChildIndex === true ) {
if ( typeof ( this.__childData ) === 'object' ) {
if ( this.emptyObject ( this.__childData ) ) {
return console.error (
'\r\n' +
'CHILD DATA DOES NOT EXIST!' + '\r\n' +
'PLEASE ADD CHILD DATA & TRY AGAIN!' +
'\r\n\r\n'
);
}
}
}
if ( this.__useChildIndex === true ) {
this.__child = this.__childData.children;
this.__childIndex = this.__childData.index;
console.error ( this.__child );
// console.error ( this.__childIndex );
}
this.__useScrollFactor = this.__objData.useScrollFactor;
this.__setNonExclusive = this.__objData.setNonExclusive;
this.__setInteractive = this.__objData.setInteractive;
this.__interactiveGeometry = this.__objData.intGeom;
this.__contains = this.__objData.contains;
this.__container = this.__scene.add.container (
this.__x,
this.__y
);
this.__container.setSize (
this.__w,
this.__h
);
if ( this.__objData.useChildIndex === false ) {
this.__container.add ( this.__child );
}
if ( this.__useChildIndex === true ) {
this.__container.addAt (
this.__child,
this.__childIndex
);
}
if ( this.__useScrollFactor === true ) {
this.__container.setScrollFactor (
this.__scrollX,
this.__scrollY
);
}
if ( this.__useScrollFactorChildren === true ) {
this.__container.setScrollFactor (
this.__scrollX,
this.__scrollY,
true
);
}
if ( this.__setInteractive === true ) {
this.__container.setInteractive (
this.__interactiveGeometry,
this.__contains
);
}
if ( this.__setNonExclusive === true ) {
this.__container.setExclusive ( false );
}
return this.__container;
},
Any help is GREATLY appreciated!