You just animate normally and use file>export.
However … if you want the SWF file to be small, it has to be vector-like, not rasterized. To make it so, you should search the AE help for “SWF”. The help will list the AE features that you should not use if you want a small SWF file. Actually, I think it lists the features that do work, since that’s a smaller list. 😉
For example, almost all effects will give you a huge SWF file, because AE will rasterize every frame, effectively giving you a sequence of JPEGs in your SWF, and that doesn’t make for a small SWF file.
The result of all this is, if you want a small SWF file, it will definitely not use AE to its potential, and you may be disappointed at the restrictions. But hey, that’s the Flash format. 🙂
Anyway, search the help.
Steve