Foam-Tac is a type of foam-safe contact cement that is designed specifically for foam. Manufactured by Beacon Adhesives. It stays flexible after its dry, so it can be used to make hinges but it also works really well for general construction. It can be used on balsa and carbon-fiber as well as foam, and has many other uses as well.
The 1oz tube has a fine tip and will last a long time since there is no air inside the tube (when you squeeze from the bottom up). This product is also available in large 2-oz bottles and 1-oz and “mini” 5ml squeeze tubes.