The goal of neuroethology is to explain behaviour in terms of the activity of nerve cells and their interactions. This can only be achieved if the experimental animal can be analysed at different levels ranging from behaviour to individual neurons. Cellular mechanisms underlying processing of neuronal information are frequently analysed using in vitro preparations where artificial stimulation replaces the natural sensory input. Although such studies provide fascinating insights into the complex computational abilities of neurons [1], the results may not be extrapolated easily to in vivo conditions, where the range of response amplitudes of neurons and their temporal activity patterns may differ considerably from artificially induced activity. In systems such as the retina of the horseshoe crab [5,6], it is now feasible to analyse the neuronal representation of visual input as it is experienced during behaviour (reviewed in Refs [7,8]). Until now, however, in most systems the underlying neuronal mechanisms have been difficult to unravel.In the fly it is possible to employ both quantitative behavioural approaches as well as in vivo electrophysiological and imaging methods to analyse how behaviourally relevant visual input is processed [9][10][11][12][13][14][15][16][17][18][19][20]. Although the latter techniques are mainly employed in the blowfly, which is relatively big, they are complemented by studies of the smaller fruitfly, Drosophila, where a broad range of genetic approaches can be applied to dissect the visual system in an increasingly specific way [21,22].We review recent progress on the encoding of optic-flow information in the blowfly. Optic flow is an important source of information about self-motion and the three-dimensional layout of the environment, not only for flies but for most moving animals including humans (Box 1, [4,[23][24][25]). Flies exploit optic flow to guide their locomotion [13] and to control compensatory head movements [26], and understanding the computational principles underlying optic-flow processing in flies could provide insights into visual-motion analysis in general.Information processing in visual systems is constrained by the spatial and temporal characteristics of the sensory input and by the biophysical properties of the neuronal circuits. Hence, to understand how visual systems encode behaviourally relevant information, we need to know about both the computational capabilities of the nervous system and the natural conditions under which animals normally operate. By combining behavioural, neurophysiological and computational approaches, it is now possible in the fly to assess adaptations that process visual-motion information under the constraints of its natural input. It is concluded that neuronal operating ranges and coding strategies appear to be closely matched to the inputs the animal encounters under behaviourally relevant conditions.