In a pattern discrimination task, bees tend to fly along the contours contained in the patterns, as revealed by an earlier study. As opposed to this, in a task involving the detection of an edge between two striped surfaces placed at two different ranges, the bees avoid contour-following, as revealed by the present study. The study shows that, in the latter task, the bees learn to suppress the otherwise innate contour-following behaviour and adopt a flight strategy that provides them with the motion parallax cues necessary to cope with this task. Thus, the animal's active behaviour determines the type of visual information to be extracted from the environment.