Hey there rohrbaugh2000,
Most fitness trackers (including the fitbit flex) use an accelerometer to track steps. This means that there needs to be movement in order for step tracking to work.
If you don't move your arms as you walk on the treadmill, the device will likely miscount steps. There are some remedies to this problem however! Depending on your gait, sometimes putting the device on your ankle (if you can fit the band around your ankle) will work! For some devices, putting the device in a pocket will work (this one is way less likely to work, but you never know!).
Good luck!
Scott