This is not so different from captcha in HTML form.
Suppose you use php on a server and you have captcha.php scritp that generates a captcha image and stores its value in a session. In the HTML form, you must use the element and set its src to captcha.php. The user will fill in the field with the text that they see in the image. In the script that receives the message, you should check if the user input matches the session values.
In flash form, this is exactly the same. You upload an image calling captcha.php and ask the user to enter an additional field. Then, when you send data to the server, you pass the value entered by the user in the captcha field, and the server matches it with the value that it stored in the session when captcha.php was called.
So basically it is the same as in the HTML form.