From the Super Mario Wiki
Whirly Fly Guys are a rare variety of Fly Guys found in the game Super Mario World 2: Yoshi's Island and its remake Yoshi's Island: Super Mario Advance 3. They flash several different colors, distinguishing them from ordinary Fly Guys. They first stand on the ground. When the Yoshi approaches the Whirly Fly Guy, the enemy simply slowly fly up, getting away from the Yoshi. The Yoshi can't stomp the Whirly Fly Guy as it hurts the Yoshi. If a Yoshi swallows them, then spits them out, the Whirly Fly Guy are changed to a green Shy Guy. They are much like normal Shy Guys at first, but when a Yoshi eats a Green Watermelon, and attempts to shoot at the Whirly Fly Guy with Seeds, Coins start to appear from the Whirly Fly Guy. When the Yoshi shoots enough seeds at the Whirly Fly Guy, one or two Extra Lifes are awarded to the Yoshi as the Whirly Fly Guy is defeated.
They appear once again in the game Yoshi Touch & Go , but they act slightly differently in this game. Here, they hide in the grass, and when Yoshi approaches, they instantly zoom into the sky. If the player defeats it before it flew away, they are awarded with four points.