Where do you get the pokeflute in Pokemon FireRed?

To get the poke flute in Pokemon firered, you have to rescue Mr. Fugi from the Pokemon tower in lavender city. But before you do this, you must go to celadon, and beat the team rocket hideout. once you've beat this, you can get the pokeflute