Appendix C. Information Objects (Server and Client) Quick Reference


Information objects are used with server-side and client-side onStatus event handlers. When the status of an object changes, the object's onStatus handler is invoked automatically. The onStatus handlers receive an Information object that usually contains at least a level and a code property. Some Information objects contain additional properties, as well.

You can use Information objects to help trap errors or inform the client when something happens. The most common onStatus Information object you will use is NetConnection.Connect.Success . When this code is received, you can use the string to control the client to start connecting SharedObjects and streams as required.

The onStatus methods must be overwritten using ActionScript or server-side ActionScript (SSAS). For example, to overwrite the onStatus event handler for the NetConnection object, you could use:

 nc = new Netconnection  nc.onStatus = function(infoObj){ trace("a Status Change occurred:"); trace(" Code: " + infoObj.code); trace(" Level: " + infoObj.level); // Test the code property for a string value challenge = (infoObj.code == "NetConnection.Connect.Success"); if (challenge) { trace("The server has accepted your connection Request"); } } 

Table C.1 lists every Information object used with Communication Server elements on the server and the client. In addition to listing all the properties for each object, the table details what the information means and suggests actions you should take. The SSAS Stream object shares the NetStream Information object details.

Table C.1. Information Object Library
Code Property Level Property What This Means Other Properties
Application.Script.Error Error

Your ActionScript produced an error.

What to Do: Review the SSAS, correct the error, save and reload the application instance.

filename : The name of the script that produced the error.

lineno : The line number where the error happened .

linebuf : The source code that produced the error.

Application.Script.Warning Warning

Your ActionScript will produce an error. This is a warning message before the error occurs.

What to Do: Review the SSAS, correct the error, save and reload the application instance.

filename : The name of the script that produced the error.

lineno : The line number where the error happened.

linebuf : The source code that produced the error.

Application.Resource.LowMemory Warning

Your SSAS has consumed most of its memory resources.

What to Do: When this code is returned, SSAS should review its resources (SharedObjects, clients and streams) and start dropping things. If the application runs out of memory, it will shut down the instance.

 
Application.Shutdown Status

The application has shut down.

What to Do: If this is a normal operation, do nothing. If this was unexpected, you should try to reconnect .

 
Application.GC Status

The application instance is about to be deleted by the server.

What to Do: Nothing.

 
Camera.muted Status

The user did not allow the camera to be accessed by the Flash player.

What to Do: Continue the application without using the camera resource or prompt the user again to access the camera.

 
Camera.unmuted Status

The user allowed the Flash player to use the camera resource.

What to Do: Connect the camera feed to the stream.

 
Microphone.Muted Status

The user did not allow the microphone resource to be accessed by the application.

What to Do: Continue the application without using the microphone resource or prompt the user again to access the microphone.

 
Microphone.Unmuted Status

The user allowed the application to use the microphone resource.

What to Do: Connect the microphone feed to the stream.

 
NetConnection.Call.Failed Error

The server-side method (function) produced an error or was not available.

What to Do: Check that the method exists. Check that you have the correct case (server methods are case sensitive). Check that you have passed the proper parameters.

Description: Details why the method call failed, which is useful for debugging.

NetConnection.Connect.AppShutdown Error

If the administrator has shut down the server, rebooted, or reloaded the application, the client will use the AppShutDown event responder to handle the error. This error will also be received if there is an unexpected shutdown of the server. You can use this to display a message to the user that the connection has been lost or you can enter the client in a reconnect loop.

What to Do: Check the server for a crashing sequence. Try reconnecting to re-establish the application and instance. Reload the application in the App Inspector.

 
NetConnection.Connect.Closed Status

When a NetConnection.close() command is issued to the server, the server will handle it using the Application.onDisconnect event. This event will change the status of the connection and will report it to the client, where the onStatus event will handle the response.

What to Do: Nothing, this is not an error state.

 
NetConnection.Connect.Failed Error

This error will be returned if the server was not found on the network.

What to Do: Ensure the server is running. Ensure you are connecting to the server with the proper URI (IP address or domain). Ensure you have the correct port. Check any firewalls to ensure the ports are open . Check your network connection.

 
NetConnection.Connect.InvalidApp Error

The server was found, but the application you referenced was not.

What to Do: Check that the application folder exists within the server's application directory. Check that you have spelled the application name correctly. If you are using NetConnection in SSAS, remember to check case sensitivity.

 
NetConnection.Connect.Rejected Error

This error is returned by the server function, Application.rejectConnection() .

What to Do: Check the values of the parameters sent from the client challenged by the server. An easy way to check these is to use a server-side trace and watch the App Inspector.

Application: Contains application information for why the connection was rejected.

NetConnection.Connect.Success Status

You have successfully connected to the server.

What to Do: Go get a coffee and comb your hair, because someone may be watching you!

 
NetStream.Buffer.Empty Status

This code is sent when there is network congestion or the stream is too big for the bandwidth. It gets triggered when the buffer contains no data during a NetStream. It may be a temporary state. When data has filled the buffer again, the NetStream.Buffer.Full status will be sent.

What to Do: Check the network connection and bandwidth between server and client. Possibly re-encode the video file, if you are streaming pre-recorded video. You should send a warning to the user, letting them know your stream is buffering.

 
NetStream.Buffer.Full Status

When the stream has been filled after being empty, this status is sent. Video will start playing again.

What to Do: Watch the video.

 
NetStream.Failed Error

This error will be sent if there is a problem with a NetStream command. This has been known to happen often when using the seek method.

What to Do: This error will happen when you quality check your application. Check that you are sending all the parameters required by the method you are calling.

Description: Contains a detailed reason why the stream failed.

NetStream.Pause.Notify Status

This is a useful status to acknowledge the client's pause request.

What to Do: Nothing.

 
NetStream.Play.Failed Error

This is a general catch-all message. If the error could not be reflected by any other message in the Information object, this code will be returned.

What to Do: check the stream name you are trying to connect to. Also, the client instance may not have sufficient read permissions set on the server by Client.readAccess .

Description: Contains a detailed reason why the Stream.play method failed.

NetStream.Play.PublishNotify Status

This is a useful message that informs all subscribers a publish stream has started.

What to Do: Possibly begin playing the subscribed stream.

 
NetStream.Play.Reset Status

This status will be returned when the play list has been flushed.

What to Do: Use this as a notification message to start the play sequence again.

 
NetStream.Play.Start Status

The stream has started to play.

What to Do: Watch the video.

Details: The name of the current stream that is playing.

NetStream.Play.Stop Status

The stream has been stopped .

What to Do: If this is a normal operation, then do nothing. If this is unexpected, then check the connection and try to reconnect. If it is a subscribed stream, the stream may have been terminated by the source or the server.

 
NetStream.Play.StreamNotFound Error

The stream requested was not found. This could be either a live stream or a recorded stream.

What to Do: Check the spelling of the stream reference. If playing a recorded stream, ensure the file exists in the proper folder.

 
NetStream.Play.UnpublishNotify Status

Every client who is subscribed to the stream will be sent this status update when the publisher has stopped sending the stream.

What to Do: You should listen for this, and handle it with a close() function.

 
NetStream.Publish.BadName Error

This error is sent to the client trying to publish a stream using a name that is already in use.

What to Do: An easy way to ensure this will not happen is to check the username upon connection and to name your streams relative to the username. You can also use this in combination with a timestamp on the stream, as in Kevin_1853.flv.

 
NetStream.Publish.Idle Status

The publisher of the subscribed stream has kept a nonactive stream open too long.

What to Do: You should close the stream to free up resources.

 
NetStream.Publish.Start Status

Your stream has started to publish.

What to Do: The stream has successfully started publishing to the server.

 
NetStream.Record.Failed Error

This error code will be returned when the stream is no longer to be recorded. Most times, this is a result of a disk becoming too full. This is also used as a catch-all error message.

What to Do: Check your hard drive for space. If you are running a quota system, ensure the streams folder has enough space.

Description: Contains a detailed reason why the stream.record method failed.

NetStream.Record.NoAccess Error

If a client tries to record a stream that still has a subscription to it, this code will be returned. The code will also notify if the folder or file is set to read only.

What to Do: Check the Client.writeAccess on the server. Check the free space on the server's hard disk.

 
NetStream.Record.Start Status

A client has started to publish a stream being recorded on the server.

What to Do: You could use this code to trigger a record light. This is important because there may be a delay in the record start.

 
NetStream.Record.Stop Status

Recording has stopped.

What to Do: Use this to notify the user that recording has finished.

 
NetStream.Seek.Failed Error

When using a seek command, this error will be returned if you try to seek to a time within the movie that doesn't exist, such as “1.

What to Do: Check the formula for your seek command. Place checks in to ensure you don't over seek or under seek.

 
NetStream.Seek.Notify Status

A successful seek command will return this status code.

What to Do: Start playing from the seek value.

 
NetStream.Unpause.Notify Status

Playback has started from the point of pause.

What to Do: Watch the video.

 
NetStream.Unpublish.Success Status

This code will be returned when a successful Close() has been sent when publishing.

What to Do: Nothing.

 
SharedObject.BadPersistence Error

This error will occur when you subscribe to a SharedObject and pass the wrong persistence value in the .get method.

What to Do: Change the persistence value to connect.

 
SharedObject.Flush.Failed Error

This error will occur on the client, usually with a local SharedObject. If the command referenced an amount of disk space that is unavailable, this error will be shown.

What to Do: Lower the amount of disk space required or prompt the user to increase the amount of disk space for local SharedObjects.

 
SharedObject.Flush.Success Status

The persistent SharedObject has been saved to hard disk successfully.

What to Do: Nothing.

 
SharedObject.UriMismatch Error

The URI (or application instance) passed by the client in the .get method does not match the (URI) of the SharedObject.

What to Do: Use the URI(nc) function to correctly access the remote SharedObject.

 


Macromedia Flash Communication Server MX
Macromedia Flash Communication Server MX
ISBN: 0735713332
EAN: 2147483647
Year: 2002
Pages: 200
Authors: Kevin Towes

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net