This paper reports the computer simulation of a flapping flexible filament in a flowing soap film using the immersed boundary method. Our mathematical formulation includes filament mass and elasticity, gravity, air resistance, and the two wires that bound the flowing soap film. The incompressible viscous Navier-Stokes equations, which are used to describe the motion of the soap film and filament in our formulation, are discretized on a fixed uniform Eulerian lattice while the filament equations are discretized on a moving Lagrangian array of points which do not necessarily coincide with the fixed Eulerian mesh points of the fluid computation. The interaction between the filament and the soap film is handled by a smoothed approximation to the Dirac delta function. This delta function approximation is used not only to interpolate the fluid velocity and to apply force to the fluid (as is commonly done in immersed boundary computations), but also to handle the mass of the filament, which is represented in our calculation as delta function layer of fluid mass density supported along the immersed filament. Because of this nonuniform density, we need to use a multigrid method for solving the discretized fluid equations. This replaces the FFT-based method that is commonly used in the uniform-density case. Our main results are as follows. (i) The sustained flapping of the filament only occurs when filament mass is included in the formulation of the model; within a certain range of mass, the more the mass of the filament, the bigger the amplitude of the flapping. (ii) When the length of filament is short enough (below some critical length), the filament always approaches its straight (rest) state, in which the filament points downstream; but when the length is larger, the system is bistable, which means that it can settle into either state (rest state or sustained flapping) depending on the initial conditions. This numerical result we observed in computer simulation is the same as that of the laboratory experiment even though the Reynolds number of the computations is lower than that of the laboratory experiment by two orders of magnitude.