Jump to content

Error when adding extended class to a Container


jacksonschwarz
 Share

Recommended Posts

When I extend a class, as shown here: 

export class AbstractType extends Phaser.GameObjects.Sprite

and try to add a subclass of that type(AbstractType) into a container,

symbols.add(symbol)

I get the following error: 

TypeError: gameObject.once is not a function
    at Container.addHandler (/Users/schwarzj/Desktop/symphonymathhtml5/node_modules/phaser/dist/phaser.js:57689:1)
    at Object.Add (/Users/schwarzj/Desktop/symphonymathhtml5/node_modules/phaser/dist/phaser.js:100986:1)
    at Container.add (/Users/schwarzj/Desktop/symphonymathhtml5/node_modules/phaser/dist/phaser.js:57790:1)
    at NumberBarController.addSymbol (/Users/schwarzj/Desktop/symphonymathhtml5/app/controllers/numberbar.controller.ts:807:12)
    at NumberBarController.layoutTask (/Users/schwarzj/Desktop/symphonymathhtml5/app/controllers/numberbar.controller.ts:481:12)
    at NumberBarController.onSoundsLoad (/Users/schwarzj/Desktop/symphonymathhtml5/app/controllers/numberbar.controller.ts:364:9)
    at EventEmitter.emit (/Users/schwarzj/Desktop/symphonymathhtml5/node_modules/phaser/dist/phaser.js:1960:1)
    at Function.AudioController.sendAudioLoadComplete (/Users/schwarzj/Desktop/symphonymathhtml5/app/controllers/audio.controller.ts:300:44)
    at EventEmitter.AudioController.onSoundsLoaded (/Users/schwarzj/Desktop/symphonymathhtml5/app/controllers/audio.controller.ts:250:25)
    at EventEmitter.emit (/Users/schwarzj/Desktop/symphonymathhtml5/node_modules/phaser/dist/phaser.js:1939:1)
TypeError: child.setScrollFactor is not a function
    at ContainerWebGLRenderer [as renderWebGL] (/Users/schwarzj/Desktop/symphonymathhtml5/node_modules/phaser/dist/phaser.js:135801:1)
    at WebGLRenderer.render (/Users/schwarzj/Desktop/symphonymathhtml5/node_modules/phaser/dist/phaser.js:63279:1)
    at CameraManager.render (/Users/schwarzj/Desktop/symphonymathhtml5/node_modules/phaser/dist/phaser.js:110694:1)
    at Systems.render (/Users/schwarzj/Desktop/symphonymathhtml5/node_modules/phaser/dist/phaser.js:25617:1)
    at SceneManager.render (/Users/schwarzj/Desktop/symphonymathhtml5/node_modules/phaser/dist/phaser.js:43412:1)
    at Game.step (/Users/schwarzj/Desktop/symphonymathhtml5/node_modules/phaser/dist/phaser.js:105691:1)
    at TimeStep.step (/Users/schwarzj/Desktop/symphonymathhtml5/node_modules/phaser/dist/phaser.js:102205:1)
    at step (/Users/schwarzj/Desktop/symphonymathhtml5/node_modules/phaser/dist/phaser.js:64607:1)

Any suggestions on how to move forward from here?

 

Thank you!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...