Understanding application flow
33
For more information on invoking server methods remotely, see the
Client."commandName"
entry in the
Server-Side ActionScript Language Reference
.
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.
CLIENT
nc.doThis(a,b)
SERVER
client.call("doThis",
callback_obj,a,b)
resultObj.onResult
"doThis",a,b
resultObj
Summary of Contents for FLASH MEDIA SERVER 2-DEVELOPING MEDIA
Page 1: ...Developing Media Applications ...
Page 6: ...6 ...
Page 10: ...10 About This Manual ...
Page 36: ...36 Flash Media Server Architecture ...
Page 80: ...80 Debugging and Monitoring Applications ...
Page 106: ...106 Application Development Tips and Tricks ...
Page 114: ...114 ...