MACROMEDIA FLASH MEDIA SERVER 2-SERVER MANAGEMENT ACTIONSCRIPT LANGUAGE Manuale Utente Pagina 110

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 155
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 109
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
107
Stream.send()
myStream.send(handlerName, [p1, ..., pN])
Invokes a remote method on a client-side NetStream object subscribing to the stream and passes it parameters of any
ActionScript data type. The server does not receive a response object, and any values returned by the client-side
method are discarded.
You can call
Stream.send() to send data over to clients subscribing to a stream. The data is passed in the p1,...,
pN
parameters to the handlerName method, which is defined on the subscribing stream. Publishing streams do not
receive remote method calls, even if they define a method called
handlerName().
You c an c a ll
Stream.send() to send metadata to clients subscribing to a live stream in a data keyframe. When a
client subscribes to a live stream after it starts playing, the client may not receive the streams metadata. This metadata
can contain any information about the stream that you want the client to know, such as the length, the name of the
speaker, and the location of the broadcast.
A data keyframe is a special data message that can be added to a live stream and stored in the memory of the server.
The data keyframe is retrieved when a client subscribes to the stream. There are two reserved values that tell the
server to set or clear a data keyframe:
@setDataFrame and @clearDataFrame. Like other data messages, a data
keyframe contains a handler name and a list of parameters. Use the following syntax to set or clear a data keyframe:
Stream.send("@setDataFrame", handlerName [, p1, p2, ..., pN ]);
You can send multiple data keyframes for each live stream. However, the handler name of the data keyframe must
be unique. Only the streams publisher and the server are allowed to set and clear data keyframes. You can call the
client-side ActionScript
NetStream.send() method or the Server-Side ActionScript Stream.send() method to set
a data keyframe in a stream. Setting data keyframes is supported in Flash Media Interactive Server 3 and Flash Media
Development Server 3 and later.
Note: The server does not need to take ownership of a stream from the client in order to send a message. After
send()
is called, the client still owns the stream as a publisher. This is different from how the
Stream.play() method behaves.
Availability
Flash Communication Server 1
Parameters
handlerName A string indicating the remote method to call on the client. The handlerName value is the name of
a method relative to the subscribing Stream object. For example, if
handlerName is doSomething, the doSomething
method at the stream level is invoked with all the
p1, ..., pN parameters. Unlike the method names in
Client.call() and NetConnection.call(), the handler name can be only one level deep (that is, it cannot have
the form object/method).
Note: Do not use a built-in method name for a handler name. For example, if the handler name is
close,the
subscribing stream will close.
p1, ..., pN Parameters of any ActionScript type, including references to other ActionScript objects. These
parameters are passed to the specified handler when it is executed on the Flash client.
Returns
A boolean value of
true if the message was sent to the client; otherwise, false.
Example
The following example calls the
onMsg() method on the client-side NetStream object and sends it the string "Hello
World"
:
Vedere la pagina 109
1 2 ... 105 106 107 108 109 110 111 112 113 114 115 ... 154 155

Commenti su questo manuale

Nessun commento