flxTween target object

  • Hello there,

    How do i get object (sprite) whose properties tween animates in tweencallback function. This function recieves flxtween object, but i cant find any variable refering to sprite that tween animates.

  • are you asking how to pass variable through tween callback function?

    if so I think something like this

    public function callback(twn:FlxTween, num:Int){

    FlxTween.tween(this, {x: x-5}, .15, {onComplete: callback.bind(_, numToPass)});

  • Yes, that did the trick. Thanks

Log in to reply