A. When a character in a story has a dream or vision of a future event that eventually comes true, it is called foreshadowing.
B. In a movie, if a character's line or actions in one scene hint at something that will happen later in the story, it is called foreshadowing.