If you're using FDT, you don't need to do anything. As long as the Flex SDK (compiler) location is known, it'll use it with the needed command line parameters - just create a launch profile and use it.
You only need ANT if you have advanced tasks you need to perform prior to compiling. And even in that case, you can set an ANT task with your commands to be ran before a launch profile runs instead of compiling within ANT.
Now, if you really need to compile from an ANT task, you use something like this...
<target name="web_compileDebug">
<exec executable="${flexdir}/bin/mxmlc.exe" failonerror="true">
<arg line="'./source/org/package/DocumentClass.as'"/>
<arg line="-source-path './source'"/>
<arg line="-default-frame-rate=60"/>
<arg line="-default-background-color=0xFFFFFF"/>
<arg line="-default-size 640 480"/>
<arg line="-strict=true"/>
<arg line="-warnings=true"/>
<arg line="-debug=true"/>
<arg line="-output './deploy/index.swf'"/>
<arg line="-target-player=10.0.0"/>
<arg line="-use-network=false"/>
</exec>
</target>
Of course, replace that with your Flex SDK locations or variables.
If you mean to compile .FLA files, then of course that cannot be done by a normal command line - you need to use a JSFL script that fires Flash and compiles the file.