Instructions
Obtain a mini mushroom. Before attempting to access the red flag in the W4 Haunted House, you'll need to shrink Mario down to miniature size. An easy way to obtain this item is to finish any prior stage with a time ending in ":11," ":22" or ":33," and a red mushroom house will appear, containing an item dispenser.
Enter the "W4 Haunted House" and proceed to the right while avoiding the "Boo" enemies. Jump onto the yellow and red-striped platform to circumvent a wall. Instead of jumping on the next revolving platform, jump to the top of the room until you hit a hidden coin box.
Attempt to leap on top of the hidden box. You may uncover additional hidden boxes in the process, but you will eventually find an empty space that allows access to the top. Proceed to the right and jump on the revolving platform.
Jump down and ignore the pipe on the left. Work your way around the giant "Boo," jump up, and move to the left.
Jump onto the red switch and leap onto the red platforms that appear. Hop from platform to platform until you reach the door. Enter the passage by pressing "Up" on the directional pad.
Head left and jump on the red switch. Rush to the right and jump on the series of temporary platforms to reach the top of the pipe entrance. Do not enter the pipe.
Tap the item slot on the bottom screen to release the mini mushroom. Jump to the wall on the left and jump again while holding the d-pad in the opposite direction to make Mario perform a wall jump. Land on a small platform suspended below a tiny passageway in the ceiling.
Perform a series of wall jumps to pass through the tiny tunnel in the ceiling. Reach the door and press "Up" on the directional pad to enter. Run to the right, and you will reach the red flag.