Author Topic: FlxTimer modification for easier callbacks  (Read 2215 times)

Titch

  • Contributor
  • ****
  • Posts: 270
  • Karma: +0/-0
  • Thing with the guy in the place.
    • View Profile
FlxTimer modification for easier callbacks
« on: Sun, Jul 10, 2011 »
Whilst porting my project from 2.x to 2.5 (an epic undertaking given that I had been working on if for a few months already) I made a little change to the FlxTimer code since the callback was really irritating me since it would cause crashes at runtime.

The change I made was in FlxTimer at line 87, which now looks like this.
Code: [Select]
if (_callback != null)
{
if (_callback.length == 1)_callback(this);
else _callback();

}
Free cake whippings every day at #flixel on irc.freenode.net.

datorum

  • Active Member
  • ***
  • Posts: 165
  • Karma: +0/-0
    • View Profile
Re: FlxTimer modification for easier callbacks
« Reply #1 on: Thu, Oct 27, 2011 »
thx, noted the same thing, for some reason the callback function gets a parameter passed...