Indicator paper changes color due to the presence of specific gases or vapors. When the indicator paper is placed inside the flask, but not submerged in the liquid, it is exposed to the vapors or gases that are present in the flask. These vapors or gases can interact with the indicator paper, causing a chemical reaction that results in a change in color.
In the case of the acetic acid and ammonia, the indicator paper likely changed color due to the presence of gaseous acetic acid and ammonia molecules. The indicator paper contains a chemical that is sensitive to these particular gases, and the color change is a way of indicating the presence of these gases.
It is important to note that indicator paper is not a precise measurement tool, and the color change may not be consistent or accurate. It is often used as a rough guide or as a qualitative rather than quantitative method of analysis.