Catalysis of the reaction: S-adenosyl-L-methionine + N-acetylserotonin = S-adenosyl-L-homocysteine + melatonin. Melatonin is also known as N-acetyl-5-methoxytryptamine.
hydroxyindole O-methyltransferase activity