Flex Builder issue

I keep on getting the following error:

Buildfile: C:\Projects\*****\flex\ant\build.xml
compile_main_debug:
[exec] Loading configuration file C:\flex3sdk\frameworks\flex-config.xml
[exec] Error: C:\Projects\*****\flex\bin-debug\main.swf (The process cannot access the file because it is being used by another process)
[exec] java.io.FileNotFoundException: C:\Projects\******\flex\bin-debug\main.swf (The process cannot access the file because it is being used by another process)
[exec]     at java.io.FileOutputStream.open(Native Method)
[exec]     at java.io.FileOutputStream.<init>(Unknown Source)
[exec]     at java.io.FileOutputStream.<init>(Unknown Source)
[exec]     at flex2.tools.Compiler.mxmlc(Compiler.java:283)
[exec]     at flex2.tools.Compiler.main(Compiler.java:53)

BUILD FAILED
C:\Projects\******\flex\ant\build.xml:44: exec returned: 1

Total time: 4 seconds

This occurs whenever Flex Builder fails to launch the application and you try to compile after that.

The only way to solve it at the moment is to close Flex Builder. When it’s closed the application gets actually launched in the stand alone Flash Player. Close the SA Flash Player. Start Flex again and compile.

Or just open up Windows Task Manager and kill FlashPlayer.exe.