I offer you a small example that can also serve as a tutorial on making photo from a webcam under Flex 2 application. The example can store photos, and download it in JPEG format with a small PHP script.
Flash movies can access the webcam of the user if it allows. It is therefore quite easy to capture an image from the webcam. However, this image is in Bitmap format, and is not recordable by the user that Flash is not access to the file system of the user.
I propose therefore in this example to see how to capture an image of the webcam, encode it in JPEG format and make it downloadable by the user, all this with Flex 2 and a small PHP script for download.
If you use Flex 3, and / or that you intend to carry out an AIR application, I recommend the very good tutorial (in English) which I am inspired by tinkerlog.com (Flex 3 offers an integrated JPEG encoder, and AIR applications can save files directly which is not the case of Flash animation)
The example is available here and the sources here.
The code is documented in order to understand each step. Please let me know your thoughts ...
If you come for the first time on Flex-info.fr, you can subscribe to the RSS feed. Thank you for your visit!




















March 25th, 2008 at 2 h 18 min
c'est trés bonne!
October 18th, 2008 at 0 h 08 min
mickael salvation, it works very well, but I'm wondering if you could help me do something similar .. I do not really know anything in flex, I just decrypt your code, and I understand the outline .. brief here is what I try to do: call a javascript pop up with the equivalent of your image on the left (the video) with the "take snapshot" button, which closes once the photograph, the picture is uploadée on the server and the link saved in database with upload.php
yet I can save the image and enter the address in base, but I can not do without "selectedSnapshot.source"
basically I can call the function uploadSnapshot () and it works directly on snapshotbitmap (for the test "if" and jpgEncoder ..)
your help would be very valuable
I dropped on a multimedia installation project and I do not have time to learn the flex in the time .. : s
kevin