BattyMilk Posted February 5, 2015 Share Posted February 5, 2015 I'm upgrading a Phaser project from 2.0.5 to 2.2.2 and this no longer works: this.myTween = game.add.tween(this.myLabel) .to({y: game.world.centerY, alpha:1}, 1000, Phaser.Easing.Quadratic.In) .to({alpha:0}, 500) .start(); this.myTween._lastChild.onComplete.add(this.myFunction, this);With Uncaught TypeError: Cannot read property 'onComplete' of undefined Searching the source, it seems all refs to _lastChild have been removed What is the best way to handle this now? Link to comment Share on other sites More sharing options...
yougotashovel Posted February 5, 2015 Share Posted February 5, 2015 I'm getting this error too, trying to find a solution. Link to comment Share on other sites More sharing options...
yougotashovel Posted February 5, 2015 Share Posted February 5, 2015 It looks like it was simplified in the latest version of Phaser to include chained tweens.tween.onComplete.add(function(){ console.log('complete');}, this);Found the solution in this topic: http://www.html5gamedevs.com/topic/11529-tween-onstart-callback-problem-in-phaser-221-works-in-204/?hl=%2Btween+%2Boncomplete Link to comment Share on other sites More sharing options...
BattyMilk Posted February 6, 2015 Author Share Posted February 6, 2015 Perfect. Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts