Seems that people have been living there continuously for quite some time... How was the language lost? I guess this might also apply to other written languages, too, but it was the Rosetta Stone/philae obelisk/comet lander that made me wonder.
The language itself was not lost. The Egyptian language, in its various stages, was regularly spoken from ~3000 BC until the 1600s AD. Hieroglyphs, as you correctly point out, did fall out of use though. This is due to their specific role as one of several systems to write the language:
Hieroglyphs are the ones everybody knows, since it's got all the "cool" people and animal like signs that show up on the giant monuments. But, with all these fancy signs, it could be a real pain to write. Thus, "true" hieroglyphs were usually limited to painted or inscribed monuments like the tomb of Seti I.
Cursive Hieroglyphs were simplified hieroglyphs for papyri- they retain many of the same forms, though their arrangement and syllabary were more formalized. One can see it in lengthy texts like the Book of the Dead. Again, they are quite detailed and precise: not what you'll count your camels with.
Hieratic was the script for everyday business. It seems to be somewhat derived from hieroglyphs, though is not simply another cursive form. We see it in things like business records and other administrative documents, and, in later periods, in Egyptian religious texts.
Demotic later evolved from and replaced Hieratic as the dominant commercial text shortly before the Persian era. It, like Hieratic, appears rather cursive and relies heavily on ligatures, as you can see in this marriage document. You may recognize the name as one of the scripts on the Rosetta stone. During the Greek era, government business often included both Greek and Demotic sections; Greek was the language of the government, but Demotic was the local language and the primary administrative script before the change of power.
Coptic appeared during the Greek occupation as a way to represent the local Demotic language in a way readable to Greeks. It used Greek letters to represent Egyptain sounds, and this had to adopt a few new characters. It's much like how the Latin "Nintendo" represents the Japanese "任天堂". This quickly became the primary script throughout the region due to its versatility. Later, it became strongly associated with the Christian church, and many important early Scriptural sections are in Coptic. Still today, some Coptic churches use it in services, and efforts have been made since the 19th century to revitalize it.
So guess which script effectively died when Theodosius I issued the Edict of Thesselonica in 380, making all citizens profess Christianity? Hieroglyphs were strongly tied to Egyptian identity, but were never really used in day to day life. So after Persians, Greeks, pagan Romans, and Christian Romans controlled Egypt, hieroglyphs didn't stand much of a chance. It wasn't used in tombs, since an Egyptian hadn't ruled Egypt for centuries, and the old Egyptian religion was now defunct by the new "state Christianity." Thus, by the 5th century, it was no longer seen at all.
Great question! I am just an amateur, but I think the first thing to remember is that even during their heyday, hieroglyphs were legible to only a small percentage of the Egyptian population. From the earliest times, the "cursive" hieratic script was also available, and Demotic (a sort of populist hieratic) developed around the middle of the first millenium BCE. Hieroglyphs were always a prestige script for very formal contexts--palaces and religious sites, mainly. Once the ancient Egyptian religion lost its prestige, hieroglyphs lost their natural habitat, so to speak. When Theodosius effectively banned all non-Christian religions in 391 CE, it was only a matter of time until knowledge of the very formal script dwindled to nothingness. That's a thumbnail sketch, but I hope it's helpful, and/or that others contribute more (or tell me where I'm wrong!).