
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
22
application.onPublish()
application.onPublish = function (clientObj, streamObj){}
Invoked when a client publishes a stream to an application. Use this event handler to send traffic to other servers
when you’re building a large-scale live broadcasting application; this is called multipoint publishing. For example, you
can support subscribers in multiple geographic locations by sending traffic from the origin server (Server A) in one
city to two origin servers in two different cities (Server B and Server C). The following is the workflow for such a
scenario:
1 A client publisher connects to Server A and starts publishing.
2 Server A receives notifications from the event handler application.onPublish() in a server-side script.
3 Inside the onPublish() handler, create two NetStream objects to Server B and Server C.
4 Call the NetStream.publish() method to redirect the publishing data from Server A to Server B and Server C.
5 Subscribers connecting to Server B and Server C get the same live stream.
In this example, the publishing client connects and publishes only to Server A. The rest of the data flow is handled
by logic in the server-side script.
Note:
You cannot change Client object properties in this handler.
Availability
Flash Media Interactive Server 3 and Flash Media Development Server 3
Parameters
clientObj A Client object; the client publishing the stream to the application.
streamObj A Stream object; the stream being published to the application.
Returns
Server ignores any return value.
Example
For a complete client-side and server-side example of multipoint publishing, see Publish from server to server in
Adobe Flash Media Server Developer Guide.
application.onStatus()
application.onStatus = function (infoObject){}
Invoked when the server encounters an error while processing a message that was targeted at this application
instance. The
application.onStatus() handler handles any Stream.onStatus() or
NetConnection.onStatus() messages that don’t find handlers. Also, there are a few status calls that come only to
application.onStatus().
Availability
Flash Communication Server 1
Parameters
infoObject An Object with code and level properties that contain information about the status of an appli-
cation. Some information objects also have
details and description properties.The following table describes the
information object property values:
Kommentare zu diesen Handbüchern