1903, in reference to fires in engines or furnaces, from flash + back (adj.). Movie plot device sense is from 1916. The hallucinogenic drug sense is attested in psychological literature from 1970, which means probably hippies were using it a few years before.