Create a contact?

OK. So in my game I have a marble that every so often will change to a new color. If the color it changes to is the same color as 2 other marbles and they each touch then it makes a match. Pretty straight forward, as I placed the match making formula in a custom contact listener class.

However, I've noticed that say 3 marbles are touching and the middle one is a color changing marble and it just so happens to change to their color, it doesn't always make a match because a "new" contact was never made, therefore my begin/end contact functions are never called thus resulting in glitchy mannerisms. What can I do to correct this issue? Any way I can create a "new" contact? Any ideas or thoughts would be greatly appreciated 🙂
You could check for touching contacts when a marble changes color. b2Body has a GetContactList() method that would serve you well in this case.
ok I have a basic idea of how the GetContactList function works, however I think I may be doing it wrong. Because I noticed sine I added it, single marbles tend to disappear, and the color changer might be touching a blue and a red and make both disappear. Here is the code I'm using.

Code:
private function checkRandomContacts():void
{
   for (var c:b2ContactEdge = _body.GetContactList() ; c ; c = c.next)
   {
      var fixtureA:b2Fixture = c.contact.GetFixtureA();
      var fixtureB:b2Fixture = c.contact.GetFixtureB();
            
      ContactHandler.BeginContact(fixtureA, fixtureB);
      ContactHandler.EndContact(fixtureA, fixtureB);
   }
}


Now this is all in addition to my CustomContactListener class, the above code and that class both call ContactHandler, which runs the code necessary to perform the match 3. Is this correct? If necessary I can post the code for my contact handler as well but I don't think that it is.
If you change filtering halfway through, you need to Refilter the body. There's a method named something like this in every version. I think it's FlagForRefiltering atm. This will recheck filtering, and generate contacts.

You have got events backwards, BeginContact and EndContact are called for you by the engine. I suggest you have a look at the (old) manual to give you an idea how events work, the principle is similar even if the specific events are different.
It's cool I changed the way the marble worked so that if it gets clicked it'll remove all marbles of the same color that it is currently. and then if 3 color changing make a match they'll be removed the same as others, which actually makes the experience a lot different. And it solves my problem lol.

Original thread: https://box2d.org/forum/viewtopic.php?t=4679