System.onStatus
663
System.onStatus
Availability
Flash Player 6.
Description
Event handler: provides a “super” event handler for certain objects.
The LocalConnection, NetStream, and SharedObject objects provide an
onStatus
event handler
that uses an information object for providing information, status, or error messages. To respond
to this event handler, you must create a function to process the information object, and you must
know the format and contents of the information object returned.
In addition to the specific
onStatus
methods provided for the objects listed above, Flash also
provides a “super” function called
System.onStatus
. If
onStatus
is invoked for a particular
object with a
level
property of
"error"
and there is no function assigned to respond to it, Flash
processes a function assigned to
System.onStatus
if it exists.
Note:
The Camera and Microphone classes also have
onStatus
handlers, but do not pass information
objects with a level property of "error". Therefore,
System.onStatus
is not called if you don’t specify a
function for these handlers.
The following example illustrates how you can create generic and specific functions to process
information objects sent by the
onStatus
method.
// Create generic function
System.onStatus = function(genericError)
{
// Your script would do something more meaningful here
trace("An error has occurred. Please try again.");
}
// Create function for NetStream object
// If the NetStream object returns a different information object
// from the one listed below, with a level property of "error",
// System.onStatus will be invoked
videoStream_ns.onStatus = function(infoObject) {
if (infoObject.code == "NetStream.Play.StreamNotFound") {
trace("Could not find video file.");
}
}
See also
Camera.onStatus
,
LocalConnection.onStatus
,
Microphone.onStatus
,
NetStream.onStatus
,
SharedObject.onStatus
Summary of Contents for FLASH MX 2004 - ACTIONSCRIPT
Page 1: ...ActionScript Reference Guide...
Page 8: ...8 Contents...
Page 12: ......
Page 24: ...24 Chapter 1 What s New in Flash MX 2004 ActionScript...
Page 54: ...54 Chapter 2 ActionScript Basics...
Page 80: ...80 Chapter 3 Writing and Debugging Scripts...
Page 82: ......
Page 110: ...110 Chapter 5 Creating Interaction with ActionScript...
Page 112: ......
Page 120: ...120 Chapter 6 Using the Built In Classes...
Page 176: ......
Page 192: ...192 Chapter 10 Working with External Data...
Page 202: ...202 Chapter 11 Working with External Media...
Page 204: ......
Page 782: ...782 Chapter 12 ActionScript Dictionary...
Page 793: ...Other keys 793 221 222 Key Key code...
Page 794: ...794 Appendix C Keyboard Keys and Key Code Values...
Page 798: ...798 Appendix D Writing Scripts for Earlier Versions of Flash Player...
Page 806: ...806 Appendix E Object Oriented Programming with ActionScript 1...
Page 816: ...816 Index...