Always check with your doctor before attempting a new exercise program, especially if as in your case you have a problem. Although you have "flat feet" you may also have other problems that cause pain and swelling of your lower legs with walking or running. Your doctor will give you a diagnosis and may suggest a podiatrist (foot doctor) or physical therapy to help correct the problems.
A physical therapist (or physiotherapist) can analyze your gait, look for any joint or muscle restrictions and give you appropriate strengthening and stretching exercises. They can also suggest appropriate footwear.
Strengthening the glutes and other hip muscles can also help to reduce problems with your lower legs by providing more proximal strength and control.
If as you say flat feet are the problem, here are two questions that address flat feet:
- Flat feet and running
- Arch strengthening exercises
Stretching Calf Muscles - If your calf muscles are tight, gently stretching after exercise may help.
Cardio - Although you say you would like to run, you appear to be able to get a good cardio workout on the elliptical. If you can do this without pain and swelling then the elliptical would be a preferable way for you to exercise. Another option that should not bother your lower legs would be running in water.
Walk before running - If you really want to run, I would suggest walking first. A pair of Nordic walking poles may help to take some of the weight off of your feet and ankles. Start slowly and gradually increase your distance. Remember that good nutrition in proper portion sizes goes along with good exercise. Good luck.