Humanoid behavior generation is one of the most formidable issues due to its complicated structure with many degrees of freedom. This paper proposes a controller for a humanoid to cope with this issue. A given task is decomposed into a sequence of modules first, each of which consists of a set of module primitives that have control parameters to realize the appropriate primitive motions. Then, these parameters are learned by sensori-motor maps between visual information (flow) and motor commands. The controller accomplishes a given task by selecting a module, a module primitive in the selected module, and its appropriate control parameters learned in advance. A face-to-face ball pass in a RoboCup context is chosen as an example task (To the best of our knowledge, this is the first trial.). The corresponding modules are approaching a ball, kicking a ball to the opponent, and trapping a ball coming to the player. In order to show the validity, the method is applied to two different huma...