Jump to content

Adding button to group: Cannot read property 'parent' of undefined


eddieone
 Share

Recommended Posts

When I try to add a button to a group, I get the undefined error. Why does that happen?

this.create = function() {
    this.pathGroup = game.add.group();
    this.pathGroup.create(50, 200, 'bamboo');
    this.pathGroup.create(600, 170, 'bamboo');
    this.treehouse = this.make.button(280, 50, 'treehouse');
    this.treehouse.onInputUp.add(this.clickPlay, this);
    this.pathGroup.add(this.treeHouse);
}

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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