
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
75
The following steps describe the workflow for publishing a stream to a remote Flash Media Interactive Server:
1 Call the NetConnection constructor, nc = new NetConnection, to create a NetConnection object.
2 Call nc.connect("rtmp://serverName/appName/appInstanceName") to connect to an application on a
remote Flash Media Interactive Server.
Note: You cannot use RTMPT, RTMPE, or RTMPTE when connecting to a remote server.
3 Call the NetStream constructor, ns = new NetStream(nc), to create a data stream over the connection.
4 Call ns.publish("myStream") to give the stream a unique name and send data over the stream to the remote
server. You can also record the data as you publish it, so that users can play it back later.
5 Clients that subscribe to this stream connect to the same application on the remote server (in a client-side script),
NetConnection.connect("rtmp://serverName/appName/appInstanceName"), and then call
NetStream.play("myStream") with the same stream name.
Availability
Flash Media Interactive Server 3 and Flash Media Development Server 3
Property summary
Method summary
Event handler summary
NetStream class constructor
ns = new NetStream(connection)
Creates a stream that can be used for publishing (sending) data through the specified NetConnection object.
However, you can create multiple streams that run simultaneously over the same connection.
Availability
Flash Media Interactive Server 3 and Flash Media Development Server 3
Parameters
connection A NetConnection object.
Property Description
NetStream.bufferTime Read-only; indicates the number of seconds assigned to the buffer by the
NetStream.setBufferTime() method.
NetStream.time Read-only; indicates the number of seconds the stream has been publishing.
Method Description
NetStream.attach() Attaches a data source to the NetStream object.
NetStream.publish() Publishes a stream to a remote server.
NetStream.send() Broadcasts a data message over a stream.
NetStream.setBufferTime() Sets the size of the outgoing buffer in seconds.
Event handler Description
NetStream.onStatus() Invoked every time a status change or error occurs in a NetStream Object.
Commenti su questo manuale