Author Topic: FlxG.overlap(players, null, null, myProcessCallBack) does not work!  (Read 1388 times)

werem

  • Member
  • **
  • Posts: 79
  • Karma: +0/-0
    • View Profile
flixel version 2.55

Error says:


TypeError: Error #1009: Cannot access a property or method of a null object reference.
   at org.flixel.system::FlxQuadTree/overlapNode()[C:\proyectos\FlashBuilder4.5\StoryTeller\src\org\flixel\system\FlxQuadTree.as:571]
   at org.flixel.system::FlxQuadTree/execute()[C:\proyectos\FlashBuilder4.5\StoryTeller\src\org\flixel\system\FlxQuadTree.as:500]
   at org.flixel.system::FlxQuadTree/execute()[C:\proyectos\FlashBuilder4.5\StoryTeller\src\org\flixel\system\FlxQuadTree.as:515]
   at org.flixel.system::FlxQuadTree/execute()[C:\proyectos\FlashBuilder4.5\StoryTeller\src\org\flixel\system\FlxQuadTree.as:509]
   at org.flixel.system::FlxQuadTree/execute()[C:\proyectos\FlashBuilder4.5\StoryTeller\src\org\flixel\system\FlxQuadTree.as:515]
   at org.flixel::FlxG$/overlap()[C:\proyectos\FlashBuilder4.5\StoryTeller\src\org\flixel\FlxG.as:968]
   at PlayState/update()[C:\proyectos\FlashBuilder4.5\StoryTeller\src\PlayState.as:108]
   at org.flixel::FlxGame/update()[C:\proyectos\FlashBuilder4.5\StoryTeller\src\org\flixel\FlxGame.as:635]
   at org.flixel::FlxGame/step()[C:\proyectos\FlashBuilder4.5\StoryTeller\src\org\flixel\FlxGame.as:585]
   at org.flixel::FlxGame/onEnterFrame()[C:\proyectos\FlashBuilder4.5\StoryTeller\src\org\flixel\FlxGame.as:453]



The line that throws the error is

this ---->      _iterator = _iterator.next;
         }
         
         return overlapProcessed;
      }
   }

line 571 function overlapNode class FlxQuadTree

Any idea?

pixelomatic

  • Active Member
  • ***
  • Posts: 131
  • Karma: +0/-0
    • View Profile
I guess you want to overlap "players" with same group in this case "players". You should call:
Code: [Select]
FlxG.overlap(players, players, overlapCallback);

If you read the error carefully, you are getting a null reference error. You are passing null as 2nd parameter.