Invoking client methods from the server

The process for invoking client-defined methods from the server is similar to the reverse case. On the client, you can attach a user-defined method to the NetConnection object used to connect to the server. The server can then use the Client.call() method to call that method remotely.

The following diagram illustrates the process of invoking a client method from the server. In the diagram, the doThis client-side method is associated with a NetConnection object called nc. The server uses the Client.call() method to invoke the doThis method. The server-side script can optionally specify a result handler object. Again, the client can return a result, and the server's onResult handler is called on the callback object sent to the client.



Call flow from server to client, with result passed back to server


The following table lists Flash Media Server Status Messages:

Code

Level

Meaning

NetStream.Clear.Success

Status

A recorded stream was deleted successfully.

NetStream.Clear.Failed

Error

A recorded stream failed to delete.

NetStream.Publish.Start

Status

An attempt to publish was successful.

NetStream.Publish.BadName

Error

An attempt was made to publish a stream that is already being published by someone else.

NetStream.Failed

Error

An attempt to use a Stream method failed.

NetStream.Unpublish.Success

Status

An attempt to unpublish was successful.

NetStream.Record.Start

Status

Recording was started.

NetStream.Record.NoAccess

Error

An attempt was made to record a read-only

stream.

NetStream.Record.Stop

Status

Recording was stopped.

NetStream.Record.Failed

Error

An attempt to record a stream failed.

NetStream.Play.Start

Status

Play was started.

NetStream.Play.StreamNotFound

Error

An attempt was made to play a stream that does not exist.

NetStream.Play.Stop

Status

Play was stopped.

NetStream.Play.Failed

Error

An attempt to play back a stream failed.

NetStream.Play.Reset

Status

A playlist was reset.

NetStream.Play.PublishNotify

Status

The initial publish to a stream was successful. This message is sent to all subscribers.

NetStream.Play.UnpublishNotify

Status

An attempt to unpublish from a stream was successful. This message is sent to all subscribers.

The NetStream.Failed and NetStream.Play.Failed information objects also have a description property, which is a string that provides a specific reason for the failure.

The NetStream.Play.Start and NetStream.Play.Failed information objects also have a details property, which is a string that provides the name of the streams being played. This is useful for multiple plays. The details property shows the name of the stream when switching from one element in the playlist to the next element.


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/fms/2/docs/00000042.html