Toontown has been patched and altered over the years, but the flying glitch is a well-known piece of the game's history. Here is how it was done.
1. Go to Donald's Dock or your own estate.
2. Head to the fishing spot and start fishing.
3. Optional — fish for a bit first if you like. The glitch still works afterwards.
4. Turn around until your back is to the water, or until you are facing a window on the greenhouse.
5. Walk backwards into the water.
6. Press Esc as you enter, before your toon starts swimming.
7. Choose Exit Toontown.
8. Confirm with yes, then run forward quickly before the game actually closes.
Done correctly, your toon is left hovering. Be aware that glitches like this are patched out over time and can behave unpredictably, so do not be surprised if it no longer functions in the current build.