ActionScript 3.0 :: Saving Webcam Picture As JPG File?
Oct 8, 2010
I have a swf that lets you take a picture with your webcam , I have changed the scaleX to -1 so that the picture on screen appears like a mirror. This works fine, when I take a screenshot I am getting a bitmapdata from the video stream, which I am also setting scaleX to -1 to preserve the image the same as from the video. But now I am trying to save that picture as a jpg file, I can't seem to save the pictures as it appears, I can only save it as the original data which is essentially the wrong way around (doesn't preserve the changes made to scaleX = -1)
Code:
bitmapData = new BitmapData(this.video.width,this.video.height);
bitmapData.draw(this.video);
// at this point the bitmapData is the webcam view, but not with the scaleX I applied before
[...]
var jpgStream:ByteArray = jpgEncoder.encode(bitmapData);
// so now this jpg data is of the picture which isn't horizontally flipped
How can I get a bitmapData from the video and preserve the scaling I applied to the video?
I have made a flash webcam application to allow the user to take a photo of themselves using a webcam. I have successfully saved the photo in my localhost. However, I would like to set the names of those photos. Currently, the photos names are generated by
$uniqueStamp = date('U');
I also have a textfield in my flash app that allows inputs from user for the photo name. For example if the user write 'MYPHOTONAME' in the textfield, the photo which will be saved in my localhost will be named 'MYPHOTONAME' too. How do I do it in Flash and in PHP? Currently I'm having some problems because I cannot send the textfield string to PHP.
Here is my flash code to send the snapshot to PHP and let the PHP save it in my localhost:
Using Flex, what is the recommended way of taking a webcam snapshot picture? Something along the lines of: var camera:Camera = Camera.getCamera(); var image:Image = /* magic goes here */
I'm totally new to AS3 and I have an upcoming project on it. It's a virtual hairstyling project but I have no idea how to get the first part to work.This is how the first part of the project goes:First, it will ask the user to take 3 pictures of themselves using the webcam (probably some buttons that says "take picture"). These 3 pictures should be saved temporarily in the flash.After all pictures are taken, it will ask user to choose one that they like the best and will proceed with the next step. And if they don't like any of it, they can take the pictures again.
I'm new to AS3 and attempting to learn it by doing a small task, I am trying to get a live local video feed from USB webcam and want to be able to capture and save screenshots from it.I have the live feed working fine, but I am struggling to capture and save a screenshot.Someone from adobe forums suggested I should use BitmapData and JPGEncoder, which I have alongside as3corelib's.[code]I think I am doing something wrong when I am capturing the binary data, or when I am encoding it to JPG.Some assistance from somebody familiar with these methods will be a huge help as I am stuck now, and I am not getting any replies from adobe forums.Both the resolution of the videoInstance object and camera feed are 640x480, and the video is displayed fine.
I have a problem with using the webcam in flash. Most of the times it works fine but sometimes the wecampicture is not updated and is outputs a constant activity level of 100%.
I didn't find a recent question so somethign might have changed:
there is any widget, ready to use, to integrate with my website in order for my users to take a picture of themselves ala Facebook when they register to my site? i guess is Flash/flex based
Im sitting here with a project that i feel i have come a long way with (found some very usefull rescources). But i am stuck now and need some guideance in short terms what i am doing is a project where users can take a snapshot of them selves by using their webcams, and then save this picture.
This is all going ok, but when i save the picture its not the same size as the webcam picture. From what i can tell there is something going wrong with the bitmap creation process, and i cant seem to figure out how to add a field that i can toss the picture into like i have done with the video. (its using addchild(bitmap) now and that just adds a small picture at a given x & y, but i cant control size of it. And the saved pictures im getting are the size of the video area, but only 1/8th is filled with the picture, rest is just white..
I'm currently developing a website in ASP .NET MVC and I require functionality for a user to be able to draw a picture on a canvas which can be saved in a database.
I have problems with webcam streaming in AS2. In AS3 I can make it visible on stage with a Camera.get call and a Video object. Because of some reasons in one of my works I have to use AS2. Can anyone provide me a working code to make visible the webcam's picture on the stage? I use the following code, but it doesn't work:
var cam = Camera.get(); //it's okay I can see the real camera name in the name property var vid:Video; vid.attachVideo(cam); //... and nothing happens on the stage Why? trace(vid) returns "undefined" Why?
i am trying to layover a background picture (bitmap) a masked area of a captured (blurry circle) webcam and add some small bitmap graphics (little squares with text) to itactualy not that hard but i want save the whole thing as jpegso on the screen everything looks fine and i managed to save a jpeg with a masked capturevideo but without the background image included ;-(so can anybody tell me how to include the background image ?here is the code so farit generates a gradient mask for the captured video
taking a screen grab of a movie clip while the webcam is on..(the end goal is to create an app where people can put funny stuff on their face e.g an eye patch ect..)Is there any simple tutorials on how to do this?, i've tried the whole matrix thing but im still having issues when i resize or move movie clips around, to get it align with someones face!
I'm trying to record video from the users webcam and play it back at a later date. I call
[Code]...
However, when I look at the FMS Admin Console at the streams in app/_definst_, their types are either "NetStream" or "Live". If they were being saved wouldn't they say "Stored"? After I close the application doing the recording, the "NetStream" type stream disappears, and after a while all the "Live" typed streams are gone too. Nothing is saved.
I have no idea what is happening. I don't know if it's a problem with my AS3 code not closing the recording properly or if I'm doing something else wrong, or maybe somethgin isn't right in the FMS?
I recently used the loadMovie action to load a .swf file to a target in the movie which it was being called from. Then I tried calling a picture to another target in the movie, but it did not load the picture as intended. I read about it on my book, but it didn't seem to work. Is there anyways on calling a picture into a target in the movie without placing the picture inside an swf file?
I want to make a picture gallery and use buttons that move you from picture to picture and backwards, but I don't want to tell button 1 to go to frame 2 and button 2 to got to frame 3 and so on (I hope you know what I mean)Can I use on button on a separate layer with the same action set? I tried something like that, but it didn't work:
on (release) { thisframe =+1 } [code]........
but it didn't work. I'm kind of new to any action script other than gotAndPlay, easy functions and all that.
step1- I got an xml that is locally loaded(works fine) step2- the content goes into a datagrid that is displayed (works fine) step3- In AS3 I dynamically add some lines to this xml file(works fine) step4- I save it locally (works fine) step5-and want the datagrid to be updated..(works not-so-well)
So, in step 4, the data is saved into the xml file, but in order to finish the save, the user has to click on the "Save as" windows in order to have the file updated of course.. and that's where's my problem, how can i tell flash to wait till the user actually saves the file, before reload the xml file in the datagrid ? here's the code :
at the end of this... on my server must appear 2 files: ex1.xml and ex2.xml. PS: when I run the first script, a blank IE page with the name of the php file appears... how can I get rid of it?
After reading previous forums I've realised there is a corrupt picture that was imported into the file. I've deleted this in the library as people have suggested but still no luck saving the file. It just saves as 1K file.
I have made a cartoon section that needs to go into a video movie, it uses a lot of movie clips etc. It needs to be very high resolution- 1920x1080 When I just export it as an avi, none of the movie clips animate- they just slide around on the first frame of their animations.
When I export is as a .mov the file size is huge and I am not even offered the ability to compress it. It is like 8 gigs. When it was finally done the movie played in slow motion- the clip was about twice as long as it should have been.When I saved the file as an swf, and then tried to convert it to an avi using a converter, all the movie clips moved in doubletime, while the animations in the timeline were fine. How can I get my flash file to play in a standard video format.
I have created an xml driven application with which the client is very happy. They currently use notepad/dw to create the xml files.They now want a "form" of some description to create the xml file to avoid writing tags and so on.I have had a good look around. There is some info about creating the xml itself in as3 (looks pretty easy), but very little about how to save that file to the clients server. I gather that the flash doesn't do this for security reasons?would i be better using php to create the form for my user rather than flash as3. Or is it better to create in as3 and then append a little php to upload the doc? Or am I going abouit this the wrong way!
I have students whose flash file works until it is saved. For instance, they create a untitled.fla file, press ctrl + enter and the swf file plays perfectly. At the end of class they save it, the next day they open it, and none of the AS is executed. The swf file plays as if no AS was ever written.
To make things even more puzzling, the file will play from different drives. For instance, if the .fla file is saved to a thumb drive, everything works. If the file is placed on the desktop everything works. If the same file is placed in a different students directory, everything works. I've contacted Adobe support, they directed me to read their (worthless) forums. I have recontacted their support trying to find some real assistance.
I was wondering if it was possible to save the contents of the output window to a separate txt file like notepad. I'm doing a project that involves testing the execution speed of flash by putting more and more objects on the screen as it plays and I need it to save the result when it freezes up or crashes.
I have a presentation to do using Flash on Wednesday and have been warned by my university that files MUST be in CS4 format. So, having used CS5 to create the whole site/presentation how much will I lose back-saving it to CS4? I'm worried I'm going to have to do a lot of the same work twice.
I have a serious of games swf's loading externally from a main menu swf.What I'm trying to do is take name of the player which they input into textfield and sent it to the XML file. After this at the end of each game I want to send the time it took to complete also to the XML file.The problem I have is I don't know to to create a new user inside the XML file and then replace the default time of 00:00:00 with the time that the player has set.NameTextField is the name of the textfield.Hourtext, Minutetext and Secondtext are the names of the timer. (They are ordered like Hourtext ':' Minutetext ':' Secondtext.
AS3 code inside Flash MainMenu.swf var XMLLoader:URLLoader = new URLLoader(); var Bytes:ByteArray = new ByteArray();