Here's an example, I tried to simplify it as much as possible. Sorry the previous reference I linked wasn't in Construct terms - in Construct the "return" parts are handled by conditions, basically if the conditions are not met, then do nothing. dropbox.com/s/6eduutskd8lif24/floodfillexample.c3p
On clicked object - mark the object for deletion, and check the four adjacent positions to see if it is the same type of object and not already marked, then repeat for each. If it is not the same type or if it is already marked, then nothing happens.
Afterwards, pick all marked objects. If the total picked is more than two, delete them. Otherwise, clear the marked status.