Macromedia flash media server 2-client-side actionscript language reference for flash media server 2 ユーザーズマニュアル

ページ / 156
142
Client-Side ActionScript Language Reference
The following example shows how to publish and record a video, and then play it back.
/* This script publishes and records video.
The recorded file will be named "allAboutMe.flv". */
var my_nc:NetConnection = new NetConnection();
my_nc.connect("rtmp://localhost/allAboutMe/mySpeech");
var publish_ns:NetStream = new NetStream(my_nc);
publish_ns.publish("allAboutMe", "record");
publish_ns.attachVideo(Camera.get());
/* This script plays the recorded file.
Note that no publishing stream is required to play a recorded file. */
var my_nc:NetConnection = new NetConnection();
my_nc.connect("rtmp://localhost/allAboutMe/mySpeech");
var subscribe_ns:NetStream = new NetStream(my_nc);
subscribe_ns.play("allAboutMe");
my_video.attachVideo(subscribe_ns);// my_video is a Video object on the 
Stage.
See also
Video.clear()
Availability
Flash Player 6.
Flash Media Server (not required).
Usage
public clear() : Void
Parameters
None.
Returns
Nothing.
Description
Method; clears the image currently displayed in the Video object. This is useful when, for 
example, the connection breaks and you want to display standby information without having 
to hide the Video object.