The word you're thinking of is facetious. It means joking or trying to be funny or witty — especially at inappropriate times. Your teacher may have said, "Stop being facetious" to you when she was trying to make an important point during a class lesson. In Moby-Dick, Ishmael feels compelled to swear certain facts to the reader so that we might believe the story that he is telling us: People ashore have indeed some indefinite idea that a whale is an enormous creature of enormous power; but I have ever found that when narrating to them some specific example of this two-fold enormousness, they have significantly complimented me upon my facetiousness; when, I declare upon my soul, I had no more idea of being facetious than Moses, when he wrote the history of the plagues of Egypt.