Macromedia Flash Media Server 2-client-side Actionscript Language Reference FOR Flash Media Server 2
|
|
Bookmark Macromedia Flash Media Server 2-client-side Actionscript Language Reference FOR Flash Media Server 2 |
About Macromedia Flash Media Server 2-client-side Actionscript Language Reference FOR Flash Media Server 2Here you can find all about Macromedia Flash Media Server 2-client-side Actionscript Language Reference FOR Flash Media Server 2 like manual and other informations. For example: review.
Macromedia Flash Media Server 2-client-side Actionscript Language Reference FOR Flash Media Server 2 manual (user guide) is ready to download for free.
On the bottom of page users can write a review. If you own a Macromedia Flash Media Server 2-client-side Actionscript Language Reference FOR Flash Media Server 2 please write about it to help other people. [ Report abuse or wrong photo | Share your Macromedia Flash Media Server 2-client-side Actionscript Language Reference FOR Flash Media Server 2 photo ]
Manual
Download
(English)Macromedia Flash Media Server 2-client-side Actionscript Language Reference FOR Flash Media Server 2, size: 1.1 MB |
Macromedia Flash Media Server 2-client-side Actionscript Language Reference FOR Flash Media Server 2
User reviews and opinions
No opinions have been provided. Be the first and add a new opinion/review.
Documents

The following example continually detects the motion level of a camera feed. Create a new video instance by selecting New Video from the Library options menu. Add an instance to the Stage and give it the instance name my_video. Add a Label component instance to the Stage and give it the instance name motionLevel_lbl, a NumericStepper with the instance name motionLevel_nstep, and a ProgressBar with the instance name motion_pb. Then add the following ActionScript to Frame 1 of the Timeline:
var my_cam:Camera = Camera.get(); var my_video:Video; my_video.attachVideo(my_cam); // Configure the ProgressBar component instance. var motion_pb:mx.controls.ProgressBar; motion_pb.mode = "manual"; motion_pb.label = "Motion: %3%%"; var motionLevel_lbl:mx.controls.Label; // Configure the NumericStepper component instance. var motionLevel_nstep:mx.controls.NumericStepper; motionLevel_nstep.minimum = 0; motionLevel_nstep.maximum = 100; motionLevel_nstep.stepSize = 5; motionLevel_nstep.value = my_cam.motionLevel; /* Continuously update the progress of the ProgressBar component instance to the activityLevel of the current Camera instance, which is defined in my_cam. */
this.onEnterFrame = function() { motion_pb.setProgress(my_cam.activityLevel, 100); }; /* When the level of activity goes above or below the number defined in Camera.motionLevel, trigger the onActivity event handler. */ my_cam.onActivity = function(isActive:Boolean) { /* If isActive equals true, set the themeColor variable to "haloGreen". Otherwise set the themeColor to "haloOrange".*/ var themeColor:String = (isActive) ? "haloGreen" : "haloOrange"; motion_pb.setStyle("themeColor", themeColor); }; function changeMotionLevel() { /* Set the motionLevel property for my_cam Camera instance to the value of the NumericStepper component instance. Maintain the current motionTimeOut value of the my_cam Camera instance.*/ my_cam.setMotionLevel(motionLevel_nstep.value, my_cam.motionTimeOut); } motionLevel_nstep.addEventListener("change", changeMotionLevel);
Camera.activityLevel, Camera.onActivity, Camera.onStatus, Camera.setMotionLevel()
public motionTimeOut : Number [read-only]
Property (read-only); the number of milliseconds between the time the camera stops detecting motion and the time Camera.onActivity(false) is invoked. The default value is 2000 (2 seconds). To set this value, use Camera.setMotionLevel().
In the following example, the ProgressBar instance changes its halo theme color when the activity level falls below the motion level. You can set the number of seconds for the motionTimeout property using a NumericStepper instance. Create a new video instance by selecting New Video from the Library options menu. Add an instance to the Stage and give it the instance name my_video. Add a Label component instance to the Stage and give it the instance name motionLevel_lbl, a NumericStepper with the instance name motionTimeOut_nstep, and a ProgressBar with the instance name motion_pb. Then add the following ActionScript to Frame 1 of the Timeline:
Method; specifies how much motion is required to invoke Camera.onActivity(true). Optionally sets the number of milliseconds that must elapse without activity before Flash considers motion to have stopped and invokes Camera.onActivity(false).
Video can be displayed regardless of the value of the motionLevel parameter. This parameter only determines when and under what circumstances Camera.onActivity is invokednot whether video is actually being captured or displayed.
To prevent the camera from detecting motion at all, pass a value of 100 for motionLevel; Camera.onActivity is never invoked. (You would probably use this value only for testing purposesfor example, to temporarily disable any actions set to occur when Camera.onActivity is invoked.) To determine the amount of motion the camera is currently detecting, use the Camera.activityLevel property.
Motion level values correspond directly to activity values. Complete lack of motion is an activity value of 0. Constant motion is an activity value of 100. Your activity value is less than your motion level value when youre not moving; when you are moving, activity values frequently exceed your motion level value. This method is similar in purpose to Microphone.setSilenceLevel(); both methods are used to specify when the onActivity event handler should be invoked. However, these methods have a significantly different impact on publishing streams: is designed to optimize bandwidth. When an audio stream is considered silent, no audio data is sent. Instead, a single message is sent, indicating that silence has started.
Microphone.setSilenceLevel()
is designed to detect motion and does not affect bandwidth usage. Even if a video stream does not detect motion, video is still sent.
The following example sends messages to the Output panel when video activity starts or stops. Change the motion sensitivity value of 30 to a higher or lower number to see how different values affect motion detection.
// assumes a Video object named "myVideoObject" is on the Stage active_cam = Camera.get(); x = 0; function motion(mode) { trace(x + ": " + mode); x++; } active_cam.onActivity = function(mode) { motion(mode); } active_cam.setMotionLevel(30, 500); myVideoObject.attachVideo(active_cam);
Camera.activityLevel, Camera.motionLevel, Camera.motionTimeOut, Camera.onActivity
public setQuality([bandwidth:Number], [quality:Number]) : Void
bandwidth An integer that specifies the maximum amount of bandwidth that the current outgoing video feed can use, in bytes per second. To specify that Flash Video can use as much bandwidth as needed to maintain the value of quality, pass 0 for bandwidth. The default value is 16384.
quality An integer that specifies the required level of picture quality, as determined by the amount of compression being applied to each video frame. Acceptable values range from 1 (lowest quality, maximum compression) to 100 (highest quality, no compression). To specify that picture quality can vary as needed to avoid exceeding bandwidth, pass 0 for quality. The default value is 0. Streams compressed with the lossless codec are larger than streams compressed with the default Sorenson codec.
Method; sets the maximum amount of bandwidth per second or the required picture quality of the current outgoing video feed. Use this method to specify which element of the outgoing video feed is more important to your applicationbandwidth use or picture quality. To indicate that bandwidth use takes precedence, pass a value for bandwidth and 0 for quality. Flash will transmit video at the highest quality possible within the specified bandwidth. If necessary, Flash will reduce picture quality to avoid exceeding the specified bandwidth. In general, as motion increases, quality decreases. To indicate that quality takes precedence, pass 0 for bandwidth and a numeric value for quality. Flash will use as much bandwidth as required to maintain the specified quality. If necessary, Flash will reduce the frame rate to maintain picture quality. In general, as motion increases, bandwidth use also increases. To specify that both bandwidth and quality are equally important, pass numeric values for both parameters. Flash will transmit video that achieves the specified quality and that doesnt exceed the specified bandwidth. If necessary, Flash will reduce the frame rate to maintain picture quality without exceeding the specified bandwidth.
The following examples illustrate how to use this method to control bandwidth use and picture quality:
// Ensure that no more than 8192 (8K/second) is used to send video. active_cam.setQuality(8192,0); /* Ensure that no more than 8192 (8K/second) is used to send video with a minimum quality of 50.*/ active_cam.setQuality(8192,50); // Ensure a minimum quality of 50, no matter how much bandwidth it takes. active_cam.setQuality(0,50);
You are specifying the correct protocol name for connecting to the server (rtmp, or rtmpt, for the Flash Media Server). You are connecting to a valid application on the correct server. You have a subdirectory in the Flash Media Server applications directory with the same name as the application specified in the connection URL. The server is running.
To distinguish among different instances of a single application, pass a value for instanceName as part of targetURI. For example, you may want to give different groups of people access to the same application without having them interact with each other. To do so, you can open multiple chat rooms at the same time, as shown below.
my_nc.connect("rtmp://www.myserver.com/chatApp/peopleWhoSew") my_nc.connect("rtmp://www.myserver.com/chatApp/peopleWhoKnit")
In another case, you may have an application named lectureSeries that records and plays back classroom lectures. To save individual lectures, pass a different value for instanceName each time you record a lecture, as shown in the following example:
// Record Mondays lecture. my_nc.connect("rtmp://www.myserver.com/lectureSeries/Monday"); // Later. my_ns.connect(my_nc); my_ns.publish("lecture", "record"); // Record Tuesdays lecture. my_nc.connect("rtmp://www.myserver.com/lectureSeries/Tuesday"); // Later. my_ns.connect(my_nc); my_ns.publish("lecture", "record"); // and so on // Play back one of the lectures. my_nc.connect("rtmp://www.myserver.com/lectureSeries/Monday"); // Later. my_ns.connect(my_nc); my_ns.play("lecture")
You can also nest instance names, as shown in the following example:
my_nc.connect("rtmp://www.myserver.com/chatApp/peopleWhoSew/Monday") my_nc.connect("rtmp://www.myserver.com/chatApp/peopleWhoSew/Tuesday")
For information on where recorded streams are stored on the server, see NetStream.publish(). If an HTML page containing a SWF file is accessed differently (with regards to domain names) from the way the SWF file itself accesses the Flash Media Server, then the connection will not be successful. This is a security feature of Flash Player. But in some cases, this may be inconvenient. For example, if a web page containing a SWF file is served on an intranet from, say, http:// deptserver.mycorp.com, it can also be accessed simply by http://deptserver. If the page is accessed via, say, http://deptServer/tcpage.htm, but the SWF file specifies deptServer.mycorp.com in targetURI, then the SWF file will not make a successful connection to the server. Similarly, if the web page and SWF file are accessed as http:// deptserver.mycorp.com/tcpage.htm, but the SWF file specifies rtmp://deptserver in targetURI, it will not connect.
Understanding file naming and domains used with this method
There are a few things you can do to prevent the security policies from inconveniencing you or your users. The first, and easiest, is to use a target URI that doesnt specify a server name. (This is applicable only if the Flash Media Server and web server are running from the same IP address.) To do so, leave off the second slash in the targetURI parameter. For example, the following commands will make Flash Player attempt to connect to the same host and domain as the web server the SWF file was served from:
The following example displays a string (inside a text field named connectionQuality_str) indicating the connection quality over the NetStream object named my_ns, according to the value of the liveDelay property.
if (my_ns.liveDelay <.5) { connectionQuality_str.text } else if (my_ns.liveDelay < connectionQuality_str.text } else { connectionQuality_str.text } = "Good"; 1) { = "Slow"; = "Network congested";
Flash Player 8. Flash Media Server 2.
public onCuePoint = function(infoObject:Object) {}
infoObject
An object with the following properties:
The name given to the cue point when it was embedded in the FLV file. The time in seconds at which the cue point occurred in the video file during playback. The type of cue point that was reached: either navigation or event. An associative array of name/value pair strings specified for this cue point. Any valid string can be used for the parameter name or value.
Property
parameters
Event handler; invoked when an embedded cue point is reached while an FLV file is playing. You can use this handler to trigger actions in your code when the video reaches a specific cue point. This lets you synchronize other actions in your application with video playback events. The following are two types of cue points that can be embedded in an FLV file:
A navigation cue point specifies a keyframe within the FLV file; the cue point's time property corresponds to that exact keyframe. Navigation cue points are often used as bookmarks or entry points to let users navigate through the video file. An event cue point is specified by time, whether or not that time corresponds to a specific keyframe. An event cue point usually represents a time in the video when something happens that could be used to trigger other application events.
You can define cue points in an FLV file when you first encode the file, or when you import a video clip in the Flash authoring tool by using the Video Import wizard. The onMetaData event handler also retrieves information about the cue points in a video file. However, the onMetaData event handler gets information about all of the cue points before the video begins playing. The onCuePoint event handler receives information about a single cue point at the time specified for that cue point during playback. Generally, if you want your code to respond to a specific cue point at the time it occurs, you should use the onCuePoint event handler to trigger some action in your code. You can use the list of cue points provided to the onMetaData event handler to let your user start playing the video at predefined points along the video stream. Pass the value of the cue point's time property to the NetStream.seek() method to play the video from that cue point.
The code in this example starts by creating new NetConnection and NetStream objects. Then it defines the onCuePoint handler for the NetStream object. The handler cycles through each named property in the infoObject object and prints the property's name and value. When it finds the property named parameters, it cycles through each parameter name in the list and prints the parameter name and value.
The following examples show some ways to use this method to play back live or recorded streams. Example 1:
var my_nc:NetConnection = new NetConnection(); my_nc.connect("rtmp://localhost/appName/appInstance"); var my_ns:NetStream = new NetStream(my_nc); my_video.attachVideo(my_ns); /* To play a live stream named "stephen" being published elsewhere using the default values -- start time is -2, length is -1, and flushPlaylists is true -- dont pass any optional parameters.*/ my_ns.play("stephen"); /* to immediately play a recorded stream named record1
starting at the beginning, for up to 100 seconds*/ my_ns.play("record1", 0, 100, true);
Example 2:
/* To play and switch between live and recorded streams: Suppose we have two live streams, live1 and live2, and three recorded streams, record1, record2, and record3. The play order is record1, live1, record2, live2, and record3.*/ var my_nc:NetConnection = new NetConnection(); my_nc.connect("rtmp://localhost/appName/appInstance"); // Create a NetStream for playing. var my_ns:NetStream = new NetStream(my_nc); my_video.attachVideo(my_ns); // Play record1. my_ns.play("record1", 0, -1, false); /* Switch from record1 to live1. live1 will start to play after record1 is done. */ my_ns.play("live1", -1, 5, false); /* Switch from live1 to record2. record2 will start to play after live1 plays for 5 seconds.*/ my_ns.play("record2", 0, -1, false); /* Interrupt the current play and play a segment in record1 again (we can implement a seek by this). */ my_ns.play("record1", 1, 5, true);
In the following example, data messages in the recorded stream file log.flv are returned at the intervals at which they were originally recorded.
var my_ns:NetStream = new NetStream(my_nc); my_ns.play("log", 0, -1);
In the following example, data messages in the recorded stream file log.flv are returned all at once, rather than at the intervals at which they were originally recorded.
var my_ns:NetStream = new NetStream(my_nc); my_ns.play("log", 0, -1, 2);
MovieClip.attachAudio(), NetStream.close(), NetStream.pause(), NetStream.publish()
public publish(name : String [, howToPublish : String] ) : Void
name A string value that identifies the stream. If you pass false, the publish operation stops. Subscribers to this stream must pass this same name when they call NetStream.play(). You dont need to include a file extension for the stream name. howToPublish "record", "append",
An optional string that specifies how to publish the stream. Valid values are and "live". The default value is "live".
If you pass "record" for howToPublish, Flash publishes and records live data, saving the recorded data to a new file named name.flv. The file is stored on the server in a subdirectory within the directory containing the server application. If the file already exists, it is overwritten. For more information on where recorded streams are stored, see the Description below. If you pass "append" for howToPublish, Flash publishes and records live data, appending the recorded data to a file named name.flv, stored on the server in a subdirectory within the directory containing the server application. If no file named name.flv is found, it is created. If you omit this parameter or pass "live", Flash publishes live data without recording it. If name.flv exists, it will be deleted.
NetStream.play(), NetStream.time
public send(handlerName : String [,p1,.,pN]) : Void
handlerName A string value that identifies the message; also the name of the ActionScript handler to receive the message. The handler name can be only one level deep (that is, it cant be of the form parent/child) and is relative to the stream object. Do not use a reserved term for a handler name. For example, my_ns.send("close") will fail.
NO T E 108
p1,.,pN Optional parameters that can be of any type. They are serialized and sent over the connection, and the receiving handler receives them in the same order. If a parameter is a circular object (for example, a linked list that is circular), the serializer handles the references correctly.
Method; broadcasts a message on the specified stream to all subscribing clients. This method is available only to the publisher of the specified stream. To process and respond to the message, create a handler in the format my_ns.HandlerName. Flash Player does not serialize methods or their data, object prototype variables, or nonenumerable variables. Also, for movie clips, Flash Player serializes the path but none of the data.
The sending client has the following script:
var my_nc:NetConnection = new NetConnection(); my_nc.connect("rtmp://myServer.myDomain.com/appName/appInstance"); var my_ns:NetStream = new NetStream(my_nc); my_ns.publish("slav", "live"); my_ns.send("Fun", "this is a test");//Fun is the handler name.
The receiving clients script looks something like this:
var my_nc:NetConnection = new NetConnection(); my_nc.connect("rtmp://myServer.myDomain.com/appName"); my_ns = new NetStream(my_nc); my_ns.play("slav", -1, -1); my_ns.Fun = function(str) { //Fun is the handler name. trace (str); }
public setBufferTime(bufferTime : Number) : Void
bufferTime The number of seconds to be buffered before Flash stops sending data (on a publishing stream) or begins displaying data (on a subscribing stream). The default value is 9. The default value for Flash Media Server bufferTime parameter is different than the default value for the standard ActionScript bufferTime parameter.
The following list summarizes how the users disk space choices interact with remote shared objects from a specified domain that request local persistence:
If the user selects Never, objects are never saved locally, and all SharedObject.flush() commands issued for the object return false. If the user selects Unlimited (by moving the slider all the way to the right), objects are saved locally up to available disk space. If the user selects None (by moving the slider all the way to the left), all SharedObject.flush() commands issued for the object return "pending" and cause Flash to ask the user if additional disk space can be allotted to make room for the object. If the user selects 10 KB, 100 KB, 1 MB, or 10 MB, objects are saved locally and SharedObject.flush() returns true if the object fits within the specified amount of space. If more space is needed, SharedObject.flush() returns "pending", and Flash asks the user if additional disk space can be allotted to make room for the object.
Additionally, if the user selects a value that is less than the amount of disk space currently being used for locally persistent data, Flash warns the user that any shared objects that have already been saved locally will be deleted.
There is no size limit when Flash Player runs from the authoring environment; the limit applies only to the stand-alone player.
N OT E 116
Method summary for the SharedObject class
SharedObject.clear()
Purges all the data from the shared object and deletes the shared object from the disk. Closes the connection between a remote shared object and the Flash Media Server. Connects to a remote shared object on the Flash Media Server. Immediately writes a locally persistent shared object to a local file. Returns a reference to a locally persistent shared object that is available only to the current client. Returns a reference to a shared object that is available to multiple clients by means of the Flash Media Server. Gets the current size of the shared object, in bytes.
SharedObject.close()
SharedObject.connect()
SharedObject.flush()
SharedObject.getLocal()
SharedObject.getRemote()
SharedObject.getSize()
SharedObject.send()
Broadcasts a message to all clients connected to the remote shared object, including the client that sent the message. Specifies the number of times per second that a clients changes to a shared object are sent to the server.
SharedObject.setFps()
Property summary for the SharedObject class
SharedObject.data
The collection of attributes assigned to the data property of the object; these attributes can be shared and/or stored.
Event handler summary for the SharedObject class
SharedObject.onStatus
Invoked every time an error, warning, or informational note is posted for a shared object. Initially invoked when the client and server shared object are synchronized after a successful call to SharedObject.connect(), and later invoked whenever any client changes the attributes of the data property of the remote shared object.
SharedObject.onSync
Constructor for the SharedObject class
For information on creating shared objects that do not require Flash Media Server, see SharedObject.getLocal(). For all other shared objects, see SharedObject.getRemote().
Flash Player 7. Flash Media Server (not required).
my_so.clear()
Method; for local shared objects, purges all the data from the shared object and deletes the shared object from the disk. The reference to my_so is still active, but my_so data properties are deleted. For remote shared objects, this method disconnects the object and purges all the data; if the shared object is locally persistent, the method also deletes the shared object from the disk. The reference to my_so is still active, but my_so data properties are deleted.
The following example sets data in the shared object, and then empties all of the data from the shared object:
var my_so:SharedObject = SharedObject.getLocal("superfoo"); my_so.data.name = "Hector"; trace("before my_so.clear():"); for (var prop in my_so.data) { trace("\t"+prop); } trace(""); my_so.clear(); trace("after my_so.clear():"); for (var prop in my_so.data) { trace("\t"+prop); }
This ActionScript displays the following message in the Output panel:
before my_so.clear(): name after my_so.clear():
myRemote_so.close()
Method; closes the connection between a remote shared object and the Flash Media Server. If a remote shared object is locally persistent, the user can make changes to the local copy of the object after this method is called. Any changes made to the local object are sent to the server the next time the user connects to the remote shared object.
SharedObject.clear(), SharedObject.connect(), SharedObject.flush()
myRemote_so.connect(myRTMPConnection)
myRTMPConnection A NetConnection object that is using the Real-Time Messaging Protocol (RTMP) to communicate with the Flash Media Server.
A Boolean value of true if the connection was successfully completed; otherwise, false.
Method; connects to a remote shared object on the Flash Media Server through the specified connection. Use this method after issuing SharedObject.getRemote(). After a successful connection, the SharedObject.onSync event handler is invoked.
Before attempting to work with a remote shared object, you should first check for a return value of true, indicating a successful connection, and then wait until you receive a result from the function you have assigned to SharedObject.onSync. If you fail to do so, any changes you make to the object locallybefore SharedObject.onSync is invokedmay be lost.
SharedObject.onSync is not invoked if this call returns false. N OT E
NetConnection class, SharedObject.getRemote(), SharedObject.onSync
var my_nc:NetConnection = new NetConnection(); my_nc.connect("rtmp://somedomain.com/applicationName"); var myRemote_so = SharedObject.getRemote("mo", my_nc.uri, false); myRemote_so.connect(my_nc);
To confirm that the local and remote copies of the shared object are in sync, use the SharedObject.onSync event handler. All clients that want to share this object must pass the same values for objectName and URI.
Understanding persistence for remote shared objects By default, the shared object is not persistent on the client or server; that is, when all clients close their connections to the shared object, it is deleted. To create a shared object that is saved locally or on the server, pass a value for persistence.
Once a value has been passed for the local persistence of a remote shared object, it is valid for the life of the object. In other words, once you have gotten a remote shared object which is not locally persistent, you cannot get the same shared object with local persistence while the shared object is active. For example, the second line of code in the following does not get a locally persistent remote shared object:
/* Get a remote shared object (remote01_so) that is persistent on the server but not on the client.*/ var remote01_so:SharedObject = SharedObject.getRemote("someObject", my_nc.uri, true); /* Get a remote shared object (remote02_so) with the same name and path as remote01_so, but with local persistence. remote02_so will just point to the same object as remote01_so, and an onStatus message will be invoked for remote2_so with the "code" value of the information object set to "SharedObject.BadPersistence".*/ var remote02_so:SharedObject = SharedObject.getRemote("someObject", my_nc.uri, "somePath");
Also, remote shared objects that are not persistent on the server are created in a different namespace from remote shared objects that are persistent on the server. Therefore, if the following line of code is added to the preceding example, no SharedObject.BadPersistence error will result because remote03_so does not point to the same object as remote01_so:
Method; broadcasts a message to all clients connected to myRemote_so, including the client that sent the message. To process and respond to the message, create a function named handlerName attached to the shared object.
The following example shows how to use send to display a message in the Output panel.
/* Create a remote shared object called myRemote_so. Place an Input Text text box named inputMsgTxt on the Stage Attach this code to a button labeled "Send Message". */ on (release) { _root.myRemote_so.send("testMsg",inputMsgTxt); } // Attach this code to the frame containing the button _root.myRemote_so.testMsg = function(recvStr){ trace(recvStr); } // Type data in the text box and press the button to see the results.
myRemote_so.setFps(updatesPerSecond)
updatesPerSecond
A number that specifies how often a clients changes to a remote shared object are sent to the server. The default value is the frame rate of the SWF file. To send changes immediately and then stop sending changes, pass 0 for updatesPerSecond. To reset updatesPerSecond to its default value, pass a value less than 0.
A Boolean value of true if the update was accepted; otherwise, false.
Method; specifies the number of times per second that a clients changes to a shared object are sent to the server. Use this method when you want to control the amount of traffic between the client and the server. For example, if the connection between the client and server is relatively slow, you may want to set updatesPerSecond to a relatively low value. Conversely, if the client is connected to a multiuser game in which timing is important, you may want to set updatesPerSecond to a relatively high value. If you want to manually control when updates are sent, issue this command with updatesPerSecond set to 0 when you want to send changes to the server. For example, if you want to let the user push a button that sends updates to the server, attach myRemoteSharedObject.setFps(0) to the button. Regardless of the value you pass for updatesPerSecond, changes are not sent to the server until SharedObject.onSync has returned a value for the previous update. That is, if the response time from the server is slow, updates may be sent to the server less frequently than the value specified in updatesPerSecond.
System class
The following example lets the user press a button to set the height and width of a video stream being displayed in the Flash Player. The height and width is set to be the same as the height and width at which the video stream was captured.
/* First attach the stream to the Video object my_video.attachVideo(videoSource).Then attach code like the following to a button. */ on (release) { _root.my_video._width = _root.my_video.width _root.my_video._height = _root.my_video.height }
Video.smoothing
public smoothing : Boolean
Property; a Boolean value that specifies whether the video should be smoothed (interpolated) when it is scaled. For smoothing to work, Flash Player must be in high-quality mode. The default value is false (no smoothing).
The following example uses a button (called smoothing_btn) to toggle the smoothing property that is applied to the video my_video when it plays in a SWF file. Create a button called smoothing_btn and add the following ActionScript to your FLA or AS file:
this.createTextField("smoothing_txt", this.getNextHighestDepth(), 0, 0, 100, 22); smoothing_txt.autoSize = true; var my_nc:NetConnection = new NetConnection(); my_nc.connect(null); var my_ns:NetStream = new NetStream(my_nc); my_video.attachVideo(my_ns); my_ns.play("video1.flv"); my_ns.onStatus = function(infoObject:Object) { updateSmoothing(); }; smoothing_btn.onRelease = function() { my_video.smoothing = !my_video.smoothing; updateSmoothing(); }; function updateSmoothing():Void { smoothing_txt.text = "smoothing = "+my_video.smoothing; }
Property (read-only); an integer specifying the width of the video stream, in pixels. This value is the same as the Camera.width property of the Camera object that is capturing (or previously captured) the video stream. You may want to use this property, for example, to ensure that the user is seeing the video at the same size at which it was captured, regardless of the actual size of the Video object on the Stage.
See the examples for Video.height.
APPENDIX A
Client-Side Information Objects
The Camera, Microphone, LocalConnection, NetConnection, NetStream, and SharedObject objects provide an onStatus event handler that uses an information object for providing information, status, or error messages. To respond to this event handler, you must create a function to process the information object, and you must know the format and contents of the information object returned. In addition to the specific onStatus handlers provided for the objects listed above, Macromedia Flash also provides a super function called System.onStatus. If onStatus is invoked for a particular object with a level property of error and there is no function assigned to respond to it, Flash processes a function assigned to System.onStatus if it exists. The following example illustrates how you can create generic and specific functions to process information objects sent by the onStatus method:
NetStream.Buffer.Full NetStream.Failed
NetStream.Pause.Notify NetStream.Play.Complete NetStream.Play.Failed
Status Status Error
NetSream.Play.InsufficientBW NetStream.Play.PublishNotify
Warning Status
NetStream.Play.Reset
NetStream.Play.Start NetStream.Play.Stop NetStream.Play.StreamNotFound
Playback has started. Playback has stopped. The client tried to play a live or recorded stream that does not exist. The subscriber is switching from one stream to another in a playlist.**** Publishing has stopped; this message is sent to all subscribers. The client tried to publish a stream that is already being published by someone else. The publisher of the stream has been idling for too long. Publishing has started. An error has occurred in recording for a reason other than those listed elsewhere in this table; for example, the disk is full.* The client tried to record a stream that is still playing, or the client tried to record (overwrite) a stream that already exists on the server with read-only status. Recording has started. Recording has stopped. The subscriber tried to use the seek command to move to a particular location in the recorded stream, but failed.
NetStream.Play.Switch
NetStream.Play.UnpublishNotify
NetStream.Publish.BadName
NetStream.Publish.Idle NetStream.Publish.Start NetStream.Record.Failed
NetStream.Record.NoAccess
NetStream.Record.Start NetStream.Record.Stop NetStream.Seek.Failed
NetStream.Seek.Notify
The subscriber has used the seek command to move to a particular location in the recorded stream. The subscriber has resumed playback. Publishing has stopped.
NetStream.Unpause.Notify NetStream.Unpublish.Success *
This information object also has a description property, which is a string that provides a more specific reason for the failure. This information object also has a details property, which is a string that provides the name of the stream currently playing on the NetStream. If you are streaming a playlist that contains multiple streams, this information object will be sent each time you begin playing a different stream in the playlist.
*** By default, outgoing messages are monitored at five-second intervals; if data is behind, the client is notified within five seconds. The interval for sampling can be configured in the Application.xml file in the Client tag. ****This information object is handled by NetStream.onPlayStatus, and is not handled by NetStream.onStatus.
SharedObject information objects
The following messages notify you when certain SharedObject activities occur:
SharedObject.BadPersistence
The persistence parameter passed to SharedObject.getRemote() is different from the one used when the shared object was created. A SharedObject.flush() method that returned "pending" has failed (the user did not allot additional disk space for the shared object when Flash Player displayed the Local Storage dialog box). A SharedObject.flush() method that returned "pending" has been successfully completed (the user allotted additional disk space for the shared object). The URI parameter passed to SharedObject.connect() is different from the one passed to SharedObject.getRemote() when the shared object was created.
Tags
Sagem D94C 12 USB I LS-J0962HL L1980Q F1409TDS Inkjet 2300 Projector Benq 46W1 MP522 R-775 785 Singer 2639 GE82P 150XL Sanyo S1 HT-S590 Dmczx1 Server 663 WO 7085 EV3 MV600 AWA 5085 EL-2901piii Orbit Raychart 425 MP450 29PT8609 Suunto T3 GT501 DES-5004 Lathe LC-37D44U SGH-C260L PB-G11 VP-D355I GT720 RX420 Coolpix 4500 HVL-rlam L227WTP-PF Photosmart E427 AG-HPG10 LE37A556p1F A785GMH 128M Displays PN50C490b3D WI 102 Doro 140R NF8-V PRO SRT 6500 TH-37PX8ESA Venture DI-604 Meglio Vestax QFO SC-L906 IV082 L-328 Super 830CF Primo Ergoracer GT RA-02 Qosmio F50 LN32B450 MXD-D4 MGS-X1 -TI-84 Plus KDL-32S2000 2X 9500 CLX-2160 XSG Review 32PFL7962D 12 1000SF 5100TX Stats FR MS-2387ARS ZUS3365 MLS100 Mypal A639 Connect ML-2510 Quicksteamer Pocketmail B2031P Armada V300 Abit KT7 For MAC Suite 5 MS-220 Arcadia CDA-9855 DBX 386 26PF9946 Scanjet 8300 ML-7300AG 42PQ3500 T4020 20SH2E 220-240V VR257
manuel d'instructions, Guide de l'utilisateur | Manual de instrucciones, Instrucciones de uso | Bedienungsanleitung, Bedienungsanleitung | Manual de Instruções, guia do usuário | инструкция | návod na použitie, Užívateľská príručka, návod k použití | bruksanvisningen | instrukcja, podręcznik użytkownika | kullanım kılavuzu, Kullanım | kézikönyv, használati útmutató | manuale di istruzioni, istruzioni d'uso | handleiding, gebruikershandleiding
Sitemap
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101







