Using FLASH/FLEX+FMS to achieve online video recording, video playback is very simple. Through the reading of API documents can basically achieve this function, this article is also intended to give a start to this piece of friends have helped.
First set up a good Flash (ActionScript 3.0) file, from the components (can be opened using CTRL+F7) library to drag the corresponding components to the Flash stage, the following figure:
After the layout of the interface, we set the group see the display text and for the button to add event monitoring, create a new ActionScript class file, write code as follows:
The following are the referenced contents:
1 public Function Publishplay (): void
2 {
3 lbname.text= "Please enter the video filename:";
4 btnpublish.label= "Start recording";
5 Btnpublish.addeventlistener (Mouseevent.click,onpublishclick);
6 btnstop.label= "Stop Recording";
7 Btnstop.addeventlistener (Mouseevent.click,onstophandler);
8 btnplay.label= "video playback";
9 Btnplay.addeventlistener (Mouseevent.click,onplayhandler);
10
One video=new video ();
Cam = Camera.getcamera ();
Mic = Microphone.getmicrophone ();
if (cam==null)
15 {
Trace ("No video camera detected");
17}
Or else
19 {
Video.attachcamera (CAM);
21}
AddChild (video);
23}