background image

Camera class

9

The Camera class lets you capture video from a video camera attached to the computer that is 
running Macromedia Flash Player. When used with Flash Media Server, this class lets you 
transmit, display, and optionally record the video being captured. With these capabilities, you 
can develop media applications such as video conferencing, instant messaging with video, and 
so on. Flash provides similar audio capabilities; for more information, see the 

Microphone 

class

 entry.

You can also use a Camera object without a server—for example, to monitor a video feed from 
a webcam attached to your local system.

To create or reference a Camera object, use the 

Camera.get()

 method.

Method summary for the Camera class

NO

T

E

When a SWF file tries to access the camera returned by 

Camera.get()

, Flash Player 

displays a Privacy dialog box that lets the user choose whether to allow or deny access 
to the camera. (Make sure your Stage size is at least 215 x 138 pixels for the Camera 
class examples; this is the minimum size Flash requires to display the dialog box.) End 
users and administrative users may also disable camera access on a per-site or global 
basis.

Method

Description

Camera.get()

Returns a reference to a Camera object for capturing 
video.

Camera.setKeyFrameInterval()

Specifies which video frames are transmitted in full 
instead of being interpolated by the video compression 
algorithm.

Camera.setLoopback()

Specifies whether to use a compressed video stream for a 
local view of what the camera is transmitting. 

Camera.setMode()

Sets aspects of the camera capture mode, including 
height, width, and frames per second.

Camera.setMotionLevel()

Specifies how much motion is required to invoke 

Camera.onActivity(true)

.

Camera.setQuality()

Sets the maximum amount of bandwidth per second or 
the required picture quality of the current outgoing video 
feed.

Содержание FLASH MEDIA SERVER 2-CLIENT-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR FLASH MEDIA SERVER...

Страница 1: ...Client Side ActionScript Language Reference for Flash Media Server 2...

Страница 2: ...the link does not imply that Macromedia endorses or accepts any responsibility for the content on those third party sites Sorenson Spark video compression and decompression technology licensed from S...

Страница 3: ...61 NetConnection class 64 NetStream class 76 SharedObject class 112 System class 137 Video class 139 Appendix A Client Side Information Objects 149 Camera information objects 151 LocalConnection info...

Страница 4: ...4 Contents...

Страница 5: ...r Flash Media Server and to understand how objects created on the client side are paired with those on the server Rside see Developing Media Applications ActionScript classes The following table lists...

Страница 6: ...r remote location System class The System class contains properties related to certain operations that take place on the user s computer such as operations with shared objects local settings for camer...

Страница 7: ...liveDelay NetStream liveDelay motionLevel Camera motionLevel motionTimeOut Camera motionTimeOut muted Camera muted Microphone muted name Camera name Microphone name names Camera names Microphone names...

Страница 8: ...a setKeyFrameInterval setLoopback Camera setLoopback setMode Camera setMode setMotionLevel Camera setMotionLevel setQuality Camera setQuality setRate Microphone setRate setSilenceLevel Microphone setS...

Страница 9: ...dialog box that lets the user choose whether to allow or deny access to the camera Make sure your Stage size is at least 215 x 138 pixels for the Camera class examples this is the minimum size Flash...

Страница 10: ...ed by the video compression algorithm Camera loopback A Boolean value that specifies whether a local view of what the camera is capturing is compressed or uncompressed Camera motionLevel A numeric val...

Страница 11: ...tting to Camera setMotionLevel If the camera is available but is not yet being used because neither Video attachVideo nor NetStream attachVideo has been called this property is set to 1 If you are str...

Страница 12: ...ance to the Stage and give it the instance name my_video Add a NumericStepper component instance to the Stage and give it the instance name bandwidth_nstep Then add the following ActionScript to Frame...

Страница 13: ...ies the maximum frame rate at which you would like the camera to capture data Example The following example detects the rate in frames per second that the camera captures data using the currentFps pro...

Страница 14: ...rames per second that the camera captures data using the currentFps property and a ProgressBar instance Create a new video instance by selecting New Video from the Library options menu Add an instance...

Страница 15: ...camera driver installed the user may specify the default camera driver in the Flash Player Camera Settings panel If no camera drivers are available or installed the method returns null If index is sp...

Страница 16: ...re your Stage size is at least 215 by 138 pixels this is the minimum size Flash requires to display the dialog box When the user responds to this dialog box the Camera onStatus event handler returns a...

Страница 17: ...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 camera_lbl and a ComboBox component instance...

Страница 18: ...ons 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 dimensions_lbl Then add the following ActionScrip...

Страница 19: ...l var my_cam Camera Camera get var my_video Video my_video attachVideo my_cam camera_lbl text my_cam index my_cam name this createTextField cameras_txt this getNextHighestDepth 25 160 160 80 cameras_t...

Страница 20: ...mera setKeyFrameInterval Camera loopback Availability Flash Player 6 Flash Media Server not required Usage public loopback Boolean read only Description Property read only a Boolean value that specifi...

Страница 21: ...d 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 The...

Страница 22: ...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_nste...

Страница 23: ...me 1 of the Timeline var motionLevel_lbl mx controls Label var motion_pb mx controls ProgressBar var motionTimeOut_nstep mx controls NumericStepper var my_cam Camera Camera get var my_video Video my_v...

Страница 24: ...r message could be displayed if my_cam muted evaluates to true 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 na...

Страница 25: ...ng New Video from the Library options menu Add an instance to the Stage and give it the instance name my_video Then add the following ActionScript to Frame 1 of the Timeline var my_cam Camera Camera g...

Страница 26: ...onds to build the array In most cases you can just use the default camera Example The following example uses the default camera unless more than one camera is available in which case the user can choo...

Страница 27: ...ust create a function to process its activity value To specify the amount of motion required to invoke Camera onActivity true and the amount of time that must elapse without activity before invoking C...

Страница 28: ...et to true and this handler is invoked with an information object whose code property is Camera Muted When a SWF file tries to access the camera Flash Player displays a Privacy dialog box that lets th...

Страница 29: ...Deny value to invoke the function System showSettings 0 See also Camera get Camera muted System showSettings Camera quality Availability Flash Player 6 Flash Media Server not required Usage public qua...

Страница 30: ...minimum 0 quality_nstep maximum 100 quality_nstep stepSize 5 quality_nstep value my_cam quality function changeQuality my_cam setQuality my_cam bandwidth quality_nstep value quality_nstep addEventList...

Страница 31: ...ow to set a value for keyframeInterval consider both bandwidth use and video playback accessibility For example specifying a higher value for keyframeInterval sending keyframes less frequently reduces...

Страница 32: ...sing cost because the local view is not simply compressed it is compressed edited for transmission as it would be over a live connection and then decompressed for local viewing To set the amount of co...

Страница 33: ...he camera does not have a native mode that matches all the parameters you pass Flash selects a capture mode that most closely synthesizes the requested mode This manipulation may involve cropping the...

Страница 34: ...geFps Void my_cam setMode my_cam width my_cam height fps_ti text fps_lbl text Current my_cam fps fps fps_ti text my_cam fps Selection setSelection 0 2 fps_ti addEventListener enter changeFps See also...

Страница 35: ...activity value of 100 Your activity value is less than your motion level value when you re not moving when you are moving activity values frequently exceed your motion level value This method is simi...

Страница 36: ...function mode motion mode active_cam setMotionLevel 30 500 myVideoObject attachVideo active_cam See also Camera activityLevel Camera motionLevel Camera motionTimeOut Camera onActivity Camera setQuali...

Страница 37: ...ity 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...

Страница 38: ...e 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 dim...

Страница 39: ...e class N OT E Flash Player displays a Privacy dialog box that lets the user choose whether to allow or deny access to the microphone Make sure your Stage size is at least 215 x 138 pixels this is the...

Страница 40: ...an array of strings reflecting the names of all available sound capture devices including sound capture cards and microphones Microphone rate The sound capture rate in kHz Microphone silenceLevel The...

Страница 41: ...trols ProgressBar activityLevel_pb mode manual activityLevel_pb label Activity Level 3 activityLevel_pb setStyle themeColor 0xFF0000 this createEmptyMovieClip sound_mc this getNextHighestDepth var act...

Страница 42: ...sound_mc this getNextHighestDepth var active_mic Microphone Microphone get sound_mc attachAudio active_mic gain_pb label Gain 3 gain_pb mode manual gain_pb setProgress active_mic gain 100 gain_nstep v...

Страница 43: ...her to a MovieClip object see MovieClip attachAudio or to a NetStream object see NetStream attachAudio The NetStream object is available only with Flash Media Server Unlike objects that you create usi...

Страница 44: ...stem showSettings 0 If the user selects Remember Flash Player no longer displays the Privacy dialog box for SWF files from this domain If Microphone get returns null either the microphone is in use by...

Страница 45: ...this createEmptyMovieClip sound_mc this getNextHighestDepth var active_mic Microphone Microphone get sound_mc attachAudio active_mic mic_lbl text active_mic index active_mic name mic_cb dataProvider M...

Страница 46: ...changes Microphone onStatus is invoked For more information see Microphone get Example This example gets the default microphone and checks whether it is muted var active_mic Microphone Microphone get...

Страница 47: ...n Class property read only retrieves an array of strings reflecting the names of all available sound capture devices without displaying the Flash Player Privacy dialog box This array behaves the same...

Страница 48: ...rence Microphone get Microphone name Microphone onActivity Availability Flash Player 6 Flash Media Server not required Usage public onActivity function active Boolean Parameters active A Boolean value...

Страница 49: ...ia Server not required Usage public onStatus function infoObject Object Parameters infoObject A parameter defined according to the status message For more information about this parameter see Micropho...

Страница 50: ...does not see this text this createTextField muted_txt this getNextHighestDepth 10 10 100 22 muted_txt autoSize true muted_txt html true muted_txt selectable false muted_txt htmlText a href asfunction...

Страница 51: ...ic rate Number read only Description Property read only the rate at which the microphone is capturing sound in kHz The default value is 8 kHz if your sound capture device supports this value Otherwise...

Страница 52: ...is normal volume Numbers below 50 specify lower than normal volume while numbers above 50 specify higher than normal volume Example The following example ensures that the microphone gain setting is le...

Страница 53: ...ate See also Microphone rate Microphone setSilenceLevel Availability Flash Player 6 Flash Media Server not required Usage public setSilenceLevel silenceLevel Number timeOut Number Void Parameters sile...

Страница 54: ...vity value of 100 After gain is appropriately adjusted your activity value is less than your silence value when you re not talking when you are talking the activity value exceeds your silence value Th...

Страница 55: ...e function silenceLevel_pb setProgress active_mic activityLevel 100 active_mic onActivity function active Boolean if active silenceLevel_pb indeterminate false silenceLevel_pb setStyle themeColor halo...

Страница 56: ...rophone Settings panel Echo suppression is an effort to reduce the effects of audio feedback which is caused when sound going out the speaker is picked up by the microphone on the same computer This i...

Страница 57: ...vel_pb label Activity Level 3 useEchoSuppression_ch selected active_mic useEchoSuppression this onEnterFrame function activityLevel_pb setProgress active_mic activityLevel 100 var chListener Object ne...

Страница 58: ...p maximum 100 silenceLevel_nstep value active_mic silenceLevel var nstepListener Object new Object nstepListener change function evt Object active_mic setSilenceLevel evt target value active_mic silen...

Страница 59: ...user controls this value using a NumericStepper instance called silenceTimeOut_nstep The ProgressBar instance called silenceLevel_pb modifies its appearance depending on whether the audio stream is co...

Страница 60: ...ovieClip getNextHighestDepth method used in this example requires Flash Player 7 or later If your SWF file includes a v2 component version 2 of the Macromedia Component Architecture use the DepthManag...

Страница 61: ...pb setProgress active_mic activityLevel 100 var chListener Object new Object chListener click function evt Object active_mic setUseEchoSuppression evt target selected useEchoSuppression_ch addEventLis...

Страница 62: ...from the microphone hardware To play live or recorded audio streaming from the Flash Media Server pass a NetStream object as source The same NetStream object can contain both audio and video informati...

Страница 63: ...s play yourVideo flv this createEmptyMovieClip flv_mc this getNextHighestDepth flv_mc attachAudio my_ns var audio_sound Sound new Sound flv_mc Add volume buttons volUp_btn onRelease function if audio_...

Страница 64: ...ia Server enables you to share audio video and data using the Macromedia Real Time Messaging Protocol RTMP For information on using Flash with an application server see http www macromedia com go flas...

Страница 65: ...kes a command or method on the server NetConnection close Closes the connection with the server NetConnection connect Connects to an application on the Flash Media Server Property read only Descriptio...

Страница 66: ...n object var my_nc NetConnection new NetConnection Get the name of the server from user input and assign it to a variable named myURL var myURL_str String serverName Connect to the service my_nc conne...

Страница 67: ...object pass null p1 pN Optional parameters to be passed to the specified method Returns Nothing Description Method invokes a command or method on the server You must create a server side function to d...

Страница 68: ...t need to recreate the shared object to reconnect Instead you can just call SharedObject connect to reestablish the connection to the shared object Also any data in the shared object that was queued w...

Страница 69: ...ame parameter is omitted Flash Player connects to the application s default instance _definst_ By default RTMP connections use port 1935 and RTMPT connections use port 80 For example the following URI...

Страница 70: ...ction sequence can enable connections to succeed that otherwise would not However during this connection sequence users may wait several seconds for multiple connection attempts to time out If you wan...

Страница 71: ...d to the server Video and audio however are not queued during the connection process Any video or audio that is streaming from the server is ignored until the connection is successfully completed For...

Страница 72: ...ew 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 Understanding file naming and domain...

Страница 73: ...p com tcpage htm script Finally if you own a domain name have access to the DNS records of that domain name and have a static IP address for your Flash Media Server you can create address A records to...

Страница 74: ...Availability Flash Player 6 Flash Communication Server MX 1 0 Usage my_nc isConnected Description Property read only a Boolean value indicating whether Flash Player is connected to the server true or...

Страница 75: ...for the NetConnection object If you want to respond to this event handler you must create a function to process the information object sent by the server For more information see Client Side Informat...

Страница 76: ...r play live real time data and previously recorded data You can also use NetStream objects to send text messages to all subscribed clients see NetStream send The following steps summarize the sequence...

Страница 77: ...icrophone get Capture audio publish_ns attachVideo Camera get Capture video publish_ns publish todays_news Begin broadcasting These lines open a stream to play the video portion of the broadcast insid...

Страница 78: ...client NetStream publish Publisher method sends streaming audio video and text messages from the client to the Flash Media Server optionally recording the stream during transmission NetStream receive...

Страница 79: ...rentFps The number of frames per second being sent or received on the publishing or subscribing stream NetStream liveDelay The number of seconds of data in a subscribing stream s buffer in live mode N...

Страница 80: ...data over this connection Publishing client contains this code my_nc NetConnection new NetConnection create NetConnection object my_nc connect rtmp myRTMPServer myDomain com app connect to server my_...

Страница 81: ...vailable only to the publisher of the specified stream You can call this method before or after you call the NetStream publish method and actually begin transmitting Subscribers who want to hear the a...

Страница 82: ...es of single frames used to create time lapse photography If this parameter is omitted Flash captures all video until you issue my_ns attachVideo null If you pass 0 Flash captures only a single video...

Страница 83: ...setMode When you specify snapShotMilliseconds you are controlling how much time elapses during playback between recorded frames When you specify fps using Camera setMode you are controlling how much...

Страница 84: ...user input var mySubj String subject Assuming the user named the stream webCamStream publish the live camera activity as webCamStream source_ns publish mySubj live See also the example for MovieClip a...

Страница 85: ...deo1 flv var buffer_interval Number setInterval checkBufferTime 100 stream_ns function checkBufferTime my_ns NetStream Void var bufferPct Number Math min Math round my_ns bufferLength my_ns bufferTime...

Страница 86: ...tream connection_nc stream_ns setBufferTime 3 my_video attachVideo stream_ns stream_ns play video1 flv var buffer_interval Number setInterval checkBufferTime 100 stream_ns function checkBufferTime my_...

Страница 87: ...l pending NetStream play calls on the stream are cleared on the server subscribers no longer receive anything that was being published on the stream If this method is called from a subscribing stream...

Страница 88: ...ion Property read only the number of frames per second being sent or received on the specified publishing or subscribing stream NetStream liveDelay Availability Flash Player 6 Flash Communication Serv...

Страница 89: ...ted NetStream onCuePoint Availability Flash Player 8 Flash Media Server 2 Usage public onCuePoint function infoObject Object Parameters infoObject An object with the following properties Property Desc...

Страница 90: ...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 auth...

Страница 91: ...h parameter name in the list and prints the parameter name and value var nc NetConnection new NetConnection nc connect null var ns NetStream new NetStream nc ns onCuePoint function infoObject Object t...

Страница 92: ...e point2 onCuePoint parameters lights end type navigation time 16 02 name point3 The parameter name lights is an arbitrary name used by the author of the example video You can give cue point parameter...

Страница 93: ...n the playhead is at the end of the video stream Example The code in this example starts by creating new NetConnection and NetStream objects Then it defines the onMetaData handler for the NetStream ob...

Страница 94: ...stream in a playlist NetStream Play Switch or when a NetStream object has played to the end NetStream Play Complete If you want to respond to this event handler you must create a function to process t...

Страница 95: ...more information see Client Side Information Objects on page 149 In addition to this NetStream onStatus handler Flash also provides a super function called System onStatus If NetStream onStatus is in...

Страница 96: ...mes play Returns Nothing Description Method pauses or resumes playback of a stream This method is available only to clients subscribed to the specified stream not to the stream s publisher The first t...

Страница 97: ...my_nc my_video attachVideo my_ns to play record1 my_ns play record1 0 1 false to play record2 my_ns play record2 0 1 false to play record3 my_ns play record3 0 1 false You click a button to pause whil...

Страница 98: ...ameter can also be used to indicate whether the stream is live or recorded The default value for start is 2 which means that Flash first tries to play the live stream specified in name If a live strea...

Страница 99: ...d immediately By default the value is true You can also specify a value of 2 or 3 for the reset parameter which is useful when playing recorded stream files that contain message data These values are...

Страница 100: ...s 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 st...

Страница 101: ...ay 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...

Страница 102: ...med 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 record...

Страница 103: ...ory named yourAppsFolder lectureSeries streams Monday var my_nc NetConnection new NetConnection my_nc connect rtmp server domain com lectureSeries Monday var my_ns NetStream new NetStream my_nc my_ns...

Страница 104: ...etStream receiveAudio Availability Flash Player 6 Flash Communication Server MX 1 0 Usage public receiveAudio receive Boolean Void Parameters receive A Boolean value that specifies whether incoming au...

Страница 105: ...d specifies whether incoming video will play on the specified stream or specifies the frame rate of the video This method is available only to clients subscribed to the specified stream not to the str...

Страница 106: ...eo false Don t display video being published Later my_ns receiveVideo 12 Display video at 12 FPS See also NetStream currentFps NetStream receiveAudio NetStream time NetStream seek Availability Flash P...

Страница 107: ...if you want to seek to time 15 and there are keyframes only at time 11 and time 17 seeking actually starts from time 17 instead of time 15 This is an approximate seeking method that works well with co...

Страница 108: ...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 v...

Страница 109: ...0 but after 30 seconds only 5 seconds of data have been sent over the connection Flash may stop sending data to the buffer until more data has been sent to the client The client will receive the initi...

Страница 110: ...e no data was sent When you stop publishing a stream by calling Netstream publish false the time property stops incrementing and is reset to 0 when you resume publishing the stream For a subscribing s...

Страница 111: ...ns attachVideo active_cam publish_ns publish SomeData live play_ns play SomeData After 10 seconds play_ns time 10 You then stop sending data for a while publish_ns attachVideo false 10 seconds later y...

Страница 112: ...object s properties to null before the application ends the calculator opens without any prior values the next time the application runs Storing and sharing data on a server A shared object can store...

Страница 113: ...server domain com chat room3 var remote_so SharedObject SharedObject getRemote users my_nc uri true remote_so connect my_nc Create a remote shared object that is persistent on the server and on the c...

Страница 114: ...red object with the same attributes but with a flat design that occupies three slots instead of one my_so data year someValue my_so data month someValue my_so data dayOfMonth someValue In this case be...

Страница 115: ...can choose to make remote shared objects persistent on the client the server or both Local shared objects are always persistent on the client up to available memory and disk space By default Flash can...

Страница 116: ...n 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...

Страница 117: ...lient that sent the message SharedObject setFps Specifies the number of times per second that a client s changes to a shared object are sent to the server Property read only Description SharedObject d...

Страница 118: ...the shared object from the disk The reference to my_so is still active but my_so data properties are deleted Example The following example sets data in the shared object and then empties all of the da...

Страница 119: ...lear SharedObject connect SharedObject flush SharedObject connect Availability Flash Player 6 Flash Communication Server MX 1 0 Usage myRemote_so connect myRTMPConnection Parameters myRTMPConnection A...

Страница 120: ...OrRemote_so data Description Property the collection of attributes assigned to the data property of the object these attributes can be shared and or stored Each attribute can be an object of any of th...

Страница 121: ...the object when it is closed create properties that are not named data to store them as shown in the following example var my_so SharedObject SharedObject getLocal superfoo my_so favoriteColor blue my...

Страница 122: ...store the object this method returns pending If the user has permanently denied local information storage for objects from this domain or if Flash is unable to save the object for any reason this meth...

Страница 123: ...ush Success or SharedObject Flush Failed For more information see Local disk space considerations on page 115 Example The following function gets a shared object my_so and fills writable properties wi...

Страница 124: ...You can also set a timer to periodically flush the shared object onto the hard disk on the server application onAppStart function application my_so SharedObject get SharedObjName true setInterval fun...

Страница 125: ...ject or gets a reference to an existing shared object This shared object can be read from or written to by SWF files delivered over non HTTPS connections If your SWF file is delivered over a non HTTPS...

Страница 126: ...sulting SWF file loads the saved text from the shared object when it starts playing Every time the user presses Enter the text in the text field is written to the shared object To use this example dra...

Страница 127: ...a user John See also SharedObject close SharedObject flush SharedObject getRemote SharedObject getRemote Availability Flash Player 6 Flash Communication Server MX 1 0 Usage SharedObject getRemote obje...

Страница 128: ...returns null Description Method returns a reference to an object that can be shared across multiple clients by means of the Flash Media Server To create a shared object that is available only to the...

Страница 129: ...ample no SharedObject BadPersistence error will result because remote03_so does not point to the same object as remote01_so var remote03_so SharedObject SharedObject getRemote someObject my_nc uri fal...

Страница 130: ...shared objects created by the other SWF file When specifying persistence do not include a domain name To specify that the path for persistence should be the same as the SWF file without having to expl...

Страница 131: ...object has the longer it takes to estimate its size For this reason estimating object size can have significant processing cost Therefore you may want to avoid using this method unless you have a spe...

Страница 132: ...ction to process the information object generated by the shared object The information object has a code property containing a string that describes the result of the onStatus handler and a level prop...

Страница 133: ...hange or delete A value of clear means either that you have successfully connected to a remote shared object that is not persistent on the server or the client or that all the properties of the object...

Страница 134: ...different client my_so data x 20 Example The following examples creates or gets a remote shared object named position var myRemote_so SharedObject SharedObject getRemote position my_nc uri false The f...

Страница 135: ...od 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 sha...

Страница 136: ...t 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...

Страница 137: ...rmation on the System class see the System class entry in the ActionScript 2 0 Language Reference System showSettings Availability Flash Player 6 Flash Media Server not required Usage public static sh...

Страница 138: ...ra get Microphone get System useCodepage Availability Flash Player 6 Flash Media Server not required Usage public static useCodepage Boolean Description Flash Media Server sends text in UTF 8 format I...

Страница 139: ...cking and deringing filters If your Flash content dynamically loads Flash Video using either progressive download or Flash Media Server you can use On2 VP6 video without having to republish your SWF f...

Страница 140: ...eo 3 Drag the Video object to the Stage and use the Property inspector to give it a unique instance name such as my_video Do not name it Video Method summary for the Video class Property summary for t...

Страница 141: ...the NetStream play command requires Flash Media Server a Camera object or null If source is null video is no longer played within the Video object You don t have to use this method if the FLV file co...

Страница 142: ...ng 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 pla...

Страница 143: ...deo deblocking Availability Flash Player 6 Flash Media Server not required Usage public deblocking Number Description Property indicates the type of deblocking filter applied to decoded video as part...

Страница 144: ...nce called deblocking_cb to your file and then add the following ActionScript to your FLA or AS file var deblocking_cb mx controls ComboBox var my_video Video my_video is a Video object on the Stage v...

Страница 145: ...Stream Play Start the height and width values will be 0 because the Video object doesn t yet have the height and width of the loaded FLV file Clip is the instance name of the movie clip that contains...

Страница 146: ...ld 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 attachVid...

Страница 147: ...e 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 exampl...

Страница 148: ...148 Client Side ActionScript Language Reference...

Страница 149: ...ject 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...

Страница 150: ...These properties are noted as footnotes in the tables For NetStream NetConnection and remote shared objects which are available only with Flash Media Server the properties of the information objects...

Страница 151: ...ess to a microphone To determine whether access to a microphone is currently denied or allowed use the Microphone muted property Code property Level property Meaning Camera Muted Status The user denie...

Страница 152: ...s been shut down for example if the application is out of memory resources and must be shut down to prevent the server from crashing or the server has been shut down NetConnection Connect Closed Statu...

Страница 153: ...nd to move to a particular location in the recorded stream but with invalid parameters NetStream Pause Notify Status The subscriber has paused playback NetStream Play Complete Status Playback has comp...

Страница 154: ...ublishing has started NetStream Record Failed Error An error has occurred in recording for a reason other than those listed elsewhere in this table for example the disk is full NetStream Record NoAcce...

Страница 155: ...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...

Страница 156: ...Flush Failed Error 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...

Отзывы: