FMS3 Series (iv): Online video recording, video playback

Source: Internet
Author: User

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}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.