Yes you can.
The compiler is free and open (http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK).
That, an editor, and Bob's your uncle.
On Windows, there's also a nice open source IDE (http://flashdevelop.org).
The one thing that's not open source is the player, and that is free.